slevithan/XRegExp — Issue #8: \s => s
Author: cloudissime
Created: 2012-03-06 18:53:05+00:00
State: open

Slight difficulty I found.

This string:

(?:“|"|")([\s\S]+?)(?:”|″|"|")\s*?:\s*?(?:“|"|")([\s\S]+?)(?:”|″|"|")

passed as a parameter to the XRegExp constructor generates the following RegExp:

/(?:“|"|")([\s\S]+?)(?:”|″|"|")s*?:s*?(?:“|"|")([\s\S]+?(?:”|″|"|")/gi

Extracted from the first string:

\s*?:\s*?

and from the second:

s*?:s*?

My current workaround as a replacement for the previous string (brackets for clarity):

[ ]*?:[ ]*?

Test text which should be matched:

"Lucky charm" : "22.7"