What does "?-mix:" mean in regex

javascript, jquery, regex

Solution

Assuming perl context, `(?-mix)` this would

- -m disable multiline matching

- -i disable case insensitive matching

- -x disable extended regex whitespace

See here: http://www.regular-expressions.info/modifiers.html

Not all regex flavors support this. JavaScript and Python apply all mode modifiers to the entire regular expression. They don't support the (?-ismx) syntax, since turning off an option is pointless when mode modifiers apply to the whole regular expressions. All options are off by default.

Problem

What does "?-mix:" mean in regex, also is this valid in javascript/jQuery? If it's not valid, what is an appropriate substitute. Update: This is the full regex `/(?-mix:^[^,;]+$)/` Its used in javascript in chrome, and I'm getting the following error: `Uncaught SyntaxError: Invalid regular expression: /(?-mix:^[^,;]+$)/: Invalid group` Note: I found this helpful: How to translate ruby regex to javascript? - (?i-mx:..) and Rails 3.0.3

Original source

Related problems