I know parsing HTML is discouraged but I know for a fact it is the best option under controlled circumstances. I my case, I am in need of a regex to find all of the pre-formatted text (<pre>
) statements on an html page. This seems easy enough to simply google but I find no results. In addition, the <pre>
statement needs to contain a string, in my case, "gisformat". In others words, this regex needs to return all of the pre-formatted text statements in an HTML file that contain "gisformat". I know it goes something like this but I'm not sure what to put in the middle: /<pre>(what should I put here)</pre>/
EDIT 1: I am using PHP and yes, I have seen this post including answer #2 RegEx match open tags except XHTML self-contained tags