Breaking News
Loading...
March 17, 2015

Regex match all newline characters within html tag in PHP

11:37 AM
I have a string that contains normal characters, white charsets and newline characters between and . This regular expression doesn't work: /<html_tag>(.*)<\/html_tag>. It is because .* doesn't match newline characters
For solution using patterm

(?s)/<html_tag>(.*?)<\/html_tag>

0 comments:

Post a Comment

 
Toggle Footer