I am trying to grab contents/tags inside form tag using preg_match_all, here is the regular expression
/<form\b[^>]*>(.*?)<\/form>/i
But i wonder, why it doesn't work! Any idea?
I am trying to grab contents/tags inside form tag using preg_match_all, here is the regular expression
/<form\b[^>]*>(.*?)<\/form>/i
But i wonder, why it doesn't work! Any idea?
Don't use regular expressions to parse HTML. Use an HTML parser.
By default, the
.
(DOT) does not match line breaks. If you enable DOT-ALL with thes
modifier, it does match those chars:Realize that you won't be able to match something like:
to name just one of the possibilities.