Wednesday 2 October 2013

regex may or maynot contain a character

regex may or maynot contain a character

i have some regex i am using in php,
(i cut most of the regex out to make it simpler)
preg_match_all('/D3m57D3m58(.+)D3m59/Uis', $content, $m)
now, this works fine for most of the stuff, but in some examples D3m57 and
D3m58 may be separated by a new line, thus no match
How can i get this to match even if there is a new line inbetween them,
but it still match even if there is not...
i cant alter the string it is matching against

No comments:

Post a Comment