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

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Toggle Footer