Regular Expressions 101

Community Patterns

1...56789...173

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(-"[^"]+"|"[^"]+"|-\w+|\w+)\s*
/
g

Description

To identify quoted strings, single terms as well as subtracting those types.

Based on: http://stackoverflow.com/questions/1883188/google-like-search-query-tokenization-string-splitting

Submitted by Michael La Voie - 9 years ago