Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
Created·2014-08-06 15:46
Flavor·JavaScript

/
"{1}(.*?)"{1}
/
g
Open regex in editor

Description

Hey folks, I try to do smth like this: var s = 'this is a "" && "string constant" and this "is another" one', result = s.match(new RegExp('"{1}(.*?)"{1}', 'g'));

console.log(result);

what it gives me back is ["""", ""string constant"", ""is another""]. How can I get smth just like ["", "string constant", "is another"]?

Many thanks for any advice

Submitted by anonymous