Hi back2arie,
For what you wrote the regular expression that's all most right.
if($string =~ /<(TEXT)>\s*(.*)\s*<\/\1>/g)
But $string had the text in multiple line. So it's not worked. You will be add 's' modifier in your code, that gives result what you expect.
if($string =~ /<(TEXT)>\s*(.*)\s*<\/\1>/gs)
's' -> Treat string as single line.
k_manimuthu
Junior Poster in Training
93 posts since Jun 2009
Reputation Points: 55
Solved Threads: 24