Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^[A-Z](?!.*__.*)([A-Z_]*)[A-Z]$
/
gm

Description

Matches only ABC_DEF, not:

  • ABC__DEF
  • _ABC_DEF
  • __ABC_DEF
  • ABC_DEF_
  • ABC_DEF__
  • _ABC_DEF_
  • _ABC__DEF_
Submitted by David Enke <david.enke@zalari.de> - 6 years ago