Wiki source for PhpRegex
=====PHP Regex Pages=====
DevPhp>>====Index====
[[PhpRegexRepository PHP Regex Repository]]
>>
====Ungreedy Match====
To simply match everything between to fixed strings. The core: ""<tt><b>(.*?)</b></tt>"". For some reason, I can't commit this to memory:
%%(php)
# DELIMITER START_FLAG (.*?) END_FLAG DELIMITER
$regex_p = '~#####(.*?)#####~';
$regex_p = sprintf('~%s(%s)%s~', preg_quote('<body>'), '.*?', preg_quote('</body>'));
%%
See also Paste20100418
====References====
[[http://www.php.net/manual/en/reference.pcre.pattern.syntax.php Pattern Syntax]] (php.net)
DevPhp>>====Index====
[[PhpRegexRepository PHP Regex Repository]]
>>
====Ungreedy Match====
To simply match everything between to fixed strings. The core: ""<tt><b>(.*?)</b></tt>"". For some reason, I can't commit this to memory:
%%(php)
# DELIMITER START_FLAG (.*?) END_FLAG DELIMITER
$regex_p = '~#####(.*?)#####~';
$regex_p = sprintf('~%s(%s)%s~', preg_quote('<body>'), '.*?', preg_quote('</body>'));
%%
See also Paste20100418
====References====
[[http://www.php.net/manual/en/reference.pcre.pattern.syntax.php Pattern Syntax]] (php.net)