Finding orphaned "put"

Peter Haworth pete at lcsql.com
Sun May 5 12:10:08 EDT 2013


Hi William,
Academic at this point but I couldn't resist improving this a bit!  I can
make it exclude single line comments starting with "--" (or whatever you
use for comment indicators) but can't think of a way to deal with block
comments, or comments part way through a line.  Here's the regexp for that:

(?im)^(?!--)\s*put\s((?!(into|after|before|\\)).)*$

I'm not sure why it didn't work for you in LC (excluding "after" and
"before") - seemed to work OK for me.

I used to automatically switch off when regular expressions were mentioned
because they look dauntingly cryptic.  But I found that with a fairly short
amount of time learning the syntax they're pretty easy to understand and
amazingly powerful.  Great for validating user input.

Pete
lcSQL Software <http://www.lcsql.com>


On Sat, May 4, 2013 at 7:30 PM, william humphrey <bill at bluewatermaritime.com
> wrote:

> But (?im)^\s*put\s((?!(into|after|before|\\)).)*$ -- works perfectly in
> BBedit. Thank you very much (just doesn't work in live code perhaps because
> I don't know how to tell livecode to use Regex in the find feature).
>
> On Sat, May 4, 2013 at 10:24 PM, william humphrey <
> bill at bluewatermaritime.com> wrote:
>
> > (?im)^\s*put\s((?!(after|into|before|\\)).)*$
> >
> >
> > the after|into|before , guessing the vertical bar means "or" but is not
> > working. It only works for whatever the first word is and then still
> finds
> > the next two.
> >
>
>
>
> --
> http://www.bluewatermaritime.com
> _______________________________________________
> 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