Standard Library

Kay C Lan lan.kc.macmail at gmail.com
Wed Aug 13 23:40:50 EDT 2014


On Wed, Aug 13, 2014 at 3:21 PM, Thierry Douez <th.douez at gmail.com> wrote:
> Here is a simple one:
>
>    put "<(?P<tag>[A-Z][A-Z0-9]*)\b[^>]*>.*?</(?P=tag)>" into RX
>
>    if matchText( anyHtmlText, RX) then put "Get it!"

Unfortunately not. At first I thought it was because I was using the
msg box which was reporting:
Error description: matchChunk: error in pattern expression
Hint: pattern error

My very first play was with the msg box so I thought I better try in a
real stack but got the same message so I pasted your code into my
favourite online Regex Tester http://regex101.com/#pcre and it
immediately reported an error with an unescaped delimiter. The /
(forward slash) was hilited in red. I placed a \ (backward slash -
regex delimiter) before it and all was well.

Thierry, thank you so much for taking the time to get me sorted out
with this, but it only reinforces my advise to any new or casual user
of regex regarding the above online tester: it wont make you an
expert, or remove the complexity or confusion you may have, but it
will certainly help you: pinpoint your errors, learn as you go, and
get you the expressions you need a whole lot faster than working with
LC + regex alone.

Regex is powerful stuff. LC + regex is just giving your stack extra
horsepower for free.




More information about the use-livecode mailing list