Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(?:(?:(?:")+((?:(?:[^\\"]+)(?:(?:(?:\\)*(?!"))?(?:\\")?)*)+)(?:"))+|([^ ]+)+)+(?: )?
/
g

Description

first group matches quoted strings second group plain text, arguments are separated with a space. example: "this is a "string"" thisisnot "another "string" with a backslash "\"" just replace " with " after matching.

Submitted by anonymous - 10 years ago