Because LC can't do two things at once.

Peter M. Brigham pmbrig at gmail.com
Sun Feb 22 12:35:39 EST 2015


Buried in that list (see below) is an item noting that even the JavaScript version of regex lacks Unicode support. Does this mean that the LC version of regex will soon no longer work? Is this being addressed in Edinburgh? Or am I misinterpreting the situation?

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Feb 22, 2015, at 11:53 AM, Michael Doub wrote:

> Thanks for pointing that out Kay.   I was curious to understand the differences and I found the following which might be of interest to folks. I cut it from http://www.regular-expressions.info/javascript.html .  As a casual regex user I have never had a problem, but your point is still very valid.
> 
> -= Mike
> 
> -------------
> 
> JavaScript supports the following modifiers, a subset of those supported by Perl:
> 
> /g enables "global" matching. When using the replace() method, specify this modifier to replace all matches, rather than only the first one.
> /i makes the regex match case insensitive.
> /m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string.
> You can combine multiple modifiers by stringing them together as in /regex/gim. Notably absent is an option to make the dot match line break characters.
> 
> Since forward slashes delimit the regular expression, any forward slashes that appear in the regex need to be escaped. E.g. the regex 1/2 is written as /1\/2/ in JavaScript.
> 
> There is indeed no /s modifier to make the dot match all characters, including line breaks. To match absolutely any character, you can use character class that contains a shorthand class and its negated version, such as [\s\S].
> 
> JavaScript implements Perl-style regular expressions. However, it lacks quite a number of advanced features available in Perl and other modern regular expression flavors:
> 
> No \A or \Z anchors to match the start or end of the string. Use a caret or dollar instead.
> Lookbehind is not supported at all. Lookahead is fully supported.
> No atomic grouping or possessive quantifiers.
> No Unicode support, except for matching single characters with \uFFFF.
> No named capturing groups. Use numbered capturing groups instead.
> No mode modifiers to set matching options within the regular expression.
> No conditionals.
> No regular expression comments. Describe your regular expression with JavaScript // comments instead, outside the regular expression string.





More information about the use-livecode mailing list