Regular Expressions 101

unnecessary closing HTML tags

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

/
[\s]*<\/body.*>[\s]*<\/html.*>[\s]*\Z
/
mD

Description

Selects the </body> and </html> tags from a string. You can probably do this with something easier, but this works

Submitted by Twineee