1. Home
  2. Knowledge Base
  3. Technology Tips & Tricks
  4. Regex to select table from HTML content

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

Was this article helpful?

Related Articles