Because LC can't do two things at once.
Michael Doub
mikedoub at gmail.com
Sun Feb 22 11:53:17 EST 2015
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.
On 2/22/15 10:18 AM, Kay C Lan wrote:
> On Sun, Feb 22, 2015 at 5:59 AM, Michael Doub <mikedoub at gmail.com> wrote:
>
>> http://www.regular-expressions.info/charclasssubtract.html -- great
>> tutorials and lots of examples
>> https://regex101.com -- my favorite testing engine, I love the way it
>> explains what is actually going on
>> http://www.regexr.com -- a whole library of interesting examples in the
>> community area.
>>
>> It should be noted that only regex101.com gives you the option to choose
> the flavour of regex to test. Most online regex sites use JavaScript yet LC
> uses the PCRE regex Library so it is possible on other sites that regex
> examples may not give the same results within LC.
>
> If planning to use regex within LC I strongly recommend using regex101.com
> and selecting pcre(php) from the top left 3 options.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list