How to tell if something is put into the message box
Kay C Lan
lan.kc.macmail at gmail.com
Fri Dec 30 04:07:43 EST 2016
On Fri, Dec 30, 2016 at 8:10 AM, Alex Tweedly <alex at tweedly.net> wrote:
> OK, I am NOT a regex expert, but ...
>
> wouldn't that give you other lines like
> put tVar into myVar
No, because \w doesn't match white space chars like space and tab.
> should it not be simply
> ^put \w$
that would only work if you have something like
put x
put y
put t
as it is only matching a single word char
> so that you don't get all the other put statements ... that "+" allows any
> number (>=1) of words.
That is where the misunderstanding is, \w is a word character,
equivalent to [a-zA-Z0-9_], not a word, so to get a single word
(variable name) that is equal to or longer than a single character you
need \w+
> And even then, you will miss
> if x = y then put tVar
That is a good point and there are other examples where my basic
suggestion would fail, but I was simply pointing out that there
already exists a simple mechanism built into Find and Replace that is
powerful and extremely useful and with a little tweaking would be able
to quickly locate what you are looking for.
Oh, and Ali's tip is very useful too!
More information about the use-livecode
mailing list