Regular Expressions 101

Community Patterns

123...6

Community Library Entry

35

Regular Expression
ECMAScript (JavaScript)

/
([+-]?(?:'.+?'|".+?"|[^+\- ]{1}[^ ]*))
/
g

Description

Attempts to mimic Google search box behavior, returning an array with the separated search strings (that keep the +/- indicator for following operations)

Submitted by mettjus - 11 years ago