I'm trying to match everything after the first occurrence of a table element and before closing a body tag in an html document.
This is the regex that I tried with:
(?:<table>(.|\s)*<\/table>)((.|\s)*)(?:<\/body>)
I got no matches for this regex. I'm using JavaScript.
When I switch to PHP mode on regex101.com, I notice that this regex leads to catastrophic backtracking. I've isolated the section that breaks it, and apparently it's this:
<table>(.|\s)*<\/table>
What's wrong with this expression?