Regular Expressions 101

Invalid HTML Attribute (Strict)

Open Workspace
  • JavaScript
  • Match
1

Regular Expression

/
^[^\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