OT: Some help with Regular Expressions

Jeff Massung massung at gmail.com
Thu Nov 4 15:57:28 EDT 2010

It would be good to know where the numbers and letters are if that's
possible. But this will get you going:

local tXX
local tYYYYY
local tZZZ

## just a simple unit test
get "A1.B35AZ.001"

## do the match
if matchText(it, "([a-z0-9]{2})\.([a-z0-9]{5})\.([a-z0-9]{3})", tXX, tYYYYY,
tZZZ) is true then
   put tXX & cr & tYYYYY & tZZZ
end if

If you need it to be more specialized (eg, the format is really:
A#.A##AA.### where A=alpha and #=number) then let me know and I can get a
better matching pattern for you.

Jeff M.

On Thu, Nov 4, 2010 at 1:48 PM, Matthias Rebbe <runrev260805 at m-r-d.de>wrote:

> Dear all,
> i have to check for an value in the format  XX.YYYYY.ZZZ (e.g.
>  A1.B35AZ.001 or a1.b35az.001)
> I have to check if the value is in the right format. I know i can do that
> with matchtext and a regular expression, but
> i do not know enough to get the regular expression to work.
> Is there anyone who might be able to help?
> Regards,
> Matthias
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

More information about the use-livecode mailing list