REGEX and Livecode

Peter Alcibiades palcibiades-first at yahoo.co.uk
Tue Jan 1 12:06:30 CST 2013


The way to think about regex is a bit different for a linux user.  If you
have stuff to do involving heavy text manipulation - finding, substituting,
rearranging, then you need to know regex.  It makes life much simpler, you
can do things at the command line that you would otherwise have to write
real programs to do.

But the way to approach it in linux is through sed and awk.  Awk in
particular is really worth mastering even if you only use it as an extension
of the command line. It can be much more, but if that's all you use it for,
its still invaluable.

Grep is also worth finding out about.  You want to find all files in a given
directory with a certain string in them, but you want to be a bit vague
about exactly what this string is.  Grep -R will do it, but you need a regex
to search for to get the right degree of vagueness.

I recently had to establish whether a given file had been deleted and placed
in an archive for subsequent use.  The archive had several thousand entries. 
Grep -R did it in a few minutes with one command.  Pipe what you find to
something suitable, and away you go.



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/REGEX-and-Livecode-tp4658514p4658582.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list