Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-05-22 00:04
Flavor·ECMAScript (JavaScript)

/
^([^“”]+)|\s([^“”]+)|^("[^"]+")|\s("[^"]+")|^('.*')\s|\s('.*')\s|^('.*')$
/
ig
Open regex in editor

Description

The regex tries to match several types of quotations trying to avoid extreme cases. Bare in mind that this was developed for a specific use and thus some of the matches might not work for you.

Submitted by Shadi Lahham