Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
([^\n<”]*?)|([^\n<’]*?)|(?:^|[^="])("[^="\n<"]*?")|('(?!(s|t|ll|d|m|ve|re)\s)[^\n<]*?')(?!(s|t|ll|d|m|ve|re))
/
ig

Description

Matches 4 different types of quoted text avoiding html element and element attributes. Single quotes allow for contractions withing the quotes.

Submitted by Shadi Lahham - 9 years ago