I've tried "m" modifier,but not working:
$reg = '/...
/m';
preg_match($reg,...,$match);
EDIT
Or maybe I need a modifier that can ignore white space like ENTER,TAB and so on. Because when I remove the white space in my regex it works.
EDIT AGAIN:
I need a modifier so that regular expression
"/aaaa b/",
"/aaaa
b/"
are the same thing,say,it just ignores the white space in regex itself.
The replaceAll() method accepts a string and a regular expression replaces the matched characters with the given string. To remove all the white spaces from an input string, invoke the replaceAll() method on it bypassing the above mentioned regular expression and an empty string as inputs.
Turn on free-spacing mode to ignore whitespace between regex tokens and allow # comments. Turn on free-spacing mode to ignore whitespace between regex tokens and allow # comments, both inside and outside character classes.
Yes, the dot regex matches whitespace characters when using Python's re module.
The modifier you need is x
print_r(preg_match('/aaa
bbb/x', 'aaabbb'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With