This is PCRE_EXTRA Modifier: PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE
Usually add X Modifier/Option/Compilation Flag
Implementations of the PCRE series should all support this function. So you just need to see if the language has a PCRE library, or if its Regex implementation supports X Option.
Popular language, such as,
PHP has: http://php.net/manual/en/reference.pcre.pattern.modifiers.php
Python also supports: http://docs.python.org/2/library/re.html#re.VERBOSE
JavaScript does not work by default because it is not PCRE and requires the XRegExp extension: http://www.xregexp.com/
Both Java and C# are available:
- Java Pattern.COMMENTS
- C# X RegExp Option
Java and C# are available, as are JVMs such as Groovy or the .Net series.
By the way, strictly speaking, this is not something at the language syntax level. It’s just that Ruby or JS supports RegExp literals, so in this sense there is no distinction between languages. It’s just a comparison of how to write multi-line strings in C/C++. unnatural.
nark regular engine supports intersection and difference operations, and also supports multiple regular expressions: you can know which of a bunch (possibly millions) of regular expressions match in one scan.
This is PCRE_EXTRA Modifier: PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE
Usually add X Modifier/Option/Compilation Flag
Implementations of the PCRE series should all support this function. So you just need to see if the language has a PCRE library, or if its Regex implementation supports X Option.
Popular language, such as,
PHP has: http://php.net/manual/en/reference.pcre.pattern.modifiers.php
Python also supports: http://docs.python.org/2/library/re.html#re.VERBOSE
JavaScript does not work by default because it is not PCRE and requires the XRegExp extension: http://www.xregexp.com/
Both Java and C# are available:
- Java Pattern.COMMENTS
- C# X RegExp Option
Java and C# are available, as are JVMs such as Groovy or the .Net series.
By the way, strictly speaking, this is not something at the language syntax level. It’s just that Ruby or JS supports RegExp literals, so in this sense there is no distinction between languages. It’s just a comparison of how to write multi-line strings in C/C++. unnatural.
All scripting languages are supported, just extend pcre
CoffeeScipt also supports it.
nark regular engine supports intersection and difference operations, and also supports multiple regular expressions: you can know which of a bunch (possibly millions) of regular expressions match in one scan.
c and c++ are not supported