REGEX and Livecode

David C. davidocoker at gmail.com
Mon Dec 31 08:40:49 EST 2012


On Mon, Dec 31, 2012 at 4:55 AM, Richmond <richmondmathewson at gmail.com> wrote:
> Sorry chaps to start a new thread on this, but, somehow lost track of the
> last one :(
>
> Having 'swallowed my pride' and accepted that there MIGHT be more to REGEX
> than
> pattern matching, as I outlined in earlier postings, I had a look at the
> URLs various people on the
> Use-List provided:
>
> Finding this one fairly thought provoking:
> http://www.regular-expressions.info/quickstart.html
>
> My thoughts were provoked in 2 ways:
>
> 1. REGEX seems useful.
>
> 2. How does one use REGEX within Livecode (and, my inevitable rider;
> cross-platform) ?
>
> Because REGEX expressions do NOT seem to be written in whatever name
> the RR/LC language is going by at the moment (HyperTalk, MetaTalk, RevTalk,
> Transcript,
> Revolution. Livecode ???).
>
> Now, as a mono-maniac for Livecode (i.e. I don't use any other programming
> languages
> on a regular basis) I am only going to go to the bother (and there does seem
> to be quite a bit of that)
> to learn REGEX if:
>
> 1. It can be, somehow, integrated into Livecode.
>
> 2. It will serve me better than the way I am doing things at the moment
> (pace earlier postings).
>
> Call me "an awkward sausage" if you will; but, I suspect that those thoughts
> may, in part at least,
> reflect the thoughts of a lot of the "silent masses" who would like to do
> all sorts of jolly data
> sorting and/or modification with Livecode.
>
> Further to this, I would like to point out this:
>
> http://lessons.runrev.com/s/lessons/m/4603/l/44092-working-with-text
>
> [ admittedly it does not, directly, refer to unicodeText fields; but that,
> as I have already found out,
> can be dealt with comparatively easily ]
>
> which makes me wonder why one needs to go and "bang one's head against the
> wall" of REGEX.

Hi Richmond,
RegEx has been incorporated directly into LiveCode since at least the
version 2.5 days which is where I came aboard. There is a very brief
"guide" starting on page 181 of the current Userguide which shows the
usage in LC without any depth for learning RegEx itself.

As to the "why" of RegEx... I can say that in other languages where it
has been incorporated, I've seen some wildly complex, almost mind
boggling text processing done with one single line of RegEx code.

With all of that said, I still personally enjoy (and prefer) the more
often used text processing capabilities of LC, far more than anything
else I've ever tried.

Regards,
David C.




More information about the use-livecode mailing list