Regular Expressions 101

Community Patterns

Invalid HTML syntax regex

0

Regular Expression
PCRE2 (PHP >=7.3)

#
</?[^\0- !-@[-`{-\x7f][^\0- !-,:-@[-`{-\x7f]*+(?!>)
#
gm

Description

A bare demo of detecting syntactically invalid HTML, created for jridgewell/proposal-regexp-atomic-and-possessive#1.

It's a proposal for the + quantifier modifier for ECMAScript regular expressions.

Currently only properly detects invalid ending tags, and is only about having the correct syntax.

Submitted by Keyacom - a year ago (Last modified a year ago)