Re: how does this regular expression works
am 14.07.2011 12:27:54 von Richard Quadling
On 13 July 2011 14:04, Shahriyar Imanov wrote:
> \(?P.*?)\<\/head\>
(?P.*?)
Options: case insensitive; ^ and $ match at line breaks
Match the characters â=9C
Match any single character that is not a line break character «.*?=C2=
=BB
Between zero and unlimited times, as few times as possible,
expanding as needed (lazy) «*?»
Match the character â=9C>â=9D literally «>»
Match the regular expression below and capture its match into
backreference with name â=9Chead_tag_innerHTMLâ=9D
«(?P.*?)»
Match any single character that is not a line break character «.*?=
»
Between zero and unlimited times, as few times as possible,
expanding as needed (lazy) «*?»
Match the characters â=9Câ=9D literally «=C2=
=BB
Created with RegexBuddy
Escaping < > ? at the wrong time is simply a redundancy. Learning when
to escape is just like learning a new language.
You only need to escape anything if you need it to be a literal character.
e.g.
something.html vs something\.html
--=20
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: how does this regular expression works
am 14.07.2011 12:29:01 von Richard Quadling
On 13 July 2011 13:42, who.cat wrote:
> ]*>(.*?)
]*>(.*?)
Options: case insensitive; ^ and $ match at line breaks
Match the characters â=9C
Match any character that is NOT a â=9C>â=9D «[^>]*»
Between zero and unlimited times, as many times as possible, giving
back as needed (greedy) «*»
Match the character â=9C>â=9D literally «>»
Match the regular expression below and capture its match into
backreference number 1 «(.*?)»
Match any single character that is not a line break character «.*?=
»
Between zero and unlimited times, as few times as possible,
expanding as needed (lazy) «*?»
Match the characters â=9Câ=9D literally «=C2=
=BB
Created with RegexBuddy
--=20
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php