Your regex is failing to take account of the newline characters.
However, parsing HTML with a regex is a bad idea. You should look at using a real HTML parser.
In reply to Re: Regex not working
by davorg
in thread Regex not working
by imrags
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |