Regular Expressions 101

Community Patterns

1...45678...301

Split quotes and single words

7

Regular Expression
ECMAScript (JavaScript)

/
"([^"\\]*(?:\\.[^"\\]*)*)"|\w+|'([^'\\]*(?:\\.[^'\\]*)*)'
/
g

Description

Find " and ' quoted strings and "orphaned"/single words in a string

Submitted by LoveIsGrief - 10 years ago