Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
((?<!<[^>]*)|(?![^<]*>))((?<=^|\W)(a))
/
g

Description

Match all words that are not in a tag. Non-matching < and > do not prevent matches. But fails to match terms between < and > if no intervening < or >

Submitted by Michael Chambers - 3 years ago