Regex help matching string

Looking for a bit of regular expression help using PHP. What is the regex for the following:

EXACTLY {{file: THEN 24 characters from a-zA-Z0-9 THEN EXACTLY }}

Example:

{{file:504c2ee3ff558cb40700000b}}

Looking to match that pattern. Thanks much.

Answers


Try:

preg_match_all('/\{\{file:[a-zA-Z\d]{24}\}\}/', $str, $matches);

Need Your Help


About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.