Hi all,

I’m trying to run a matchChunk regex on an LC script text, with the aim of 
scoring a hit only if a word is NOT commented out by one of the comment methods.

This regex works beautifully when tested in regex101.com (PCRE flavor):

(?i)^(?:(?!--|#|\/\/).)*\b(myHandler)\b

When applied on the text

command myOtherHandler
   # myHandler
  // myHandler
  -- myhandler
  notMyHandler
end myOtherHandler

it should score zero matches and it does.


When applied on the text

command myOtherHandler
   # myHandler
  // myHandler
  -- myhandler
   myHandler
end myOtherHandler

it should score 1 match and it does.

Applying the same regex in LC does NOT score any match in the latter example 
though.

Why? Doesn't negative lookahead work in LC? (v9.6.9 stable.)

Best,
Andreas
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to