I am wondering if someone could please help me convert a piece of PHP code that is now deprecated.
Here is the single line I am trying to convert:
eregi("<text>(.*)TYPE[ \r\n]*(OF|or)[ \r\n]*REPORTING[ \r\n]*PERSON",$string,$outp);
When I convert to the following:
preg_match("/<text>(.*)TYPE[ \r\n]*(OF|or)[ \r\n]*REPORTING[ \r\n]*PERSON/i",$string,$outp);
It matched nothing. The original eregi function works well.
You need the
/isflag at the end of the regex.The reason is that the preg_ function does not match linebreaks with
.*, whereas the old ereg functions would do that per default.Otherwise your regular expression should work unchanged with PCRE.