Regex to select table from HTML content

The following regular expression (regex) will select a table from HTML content.

<table.*>(.|\n)*?<\/table>

What about case sensitivity? e.g. <TABLE> Use the /i (insensitive) flag

Want to select more than one table? Use the /g (global) flag

Want to select only one table? Don’t use the /g (global) flag