Regular Expressions 101

Community Patterns

Invalid HTML Attribute (Strict)

1

Regular Expression
ECMAScript (JavaScript)

/
^[^\p{L}:]|.[^\p{L}0-9:\-_]|[^\p{L}0-9]$
/
u

Description

This version of the regex is less permissive than the w3c documentation.. It matches only the common attribute syntax.

Submitted by bye-csavier - 14 days ago