Q: dynamic usage of regex in a repeat loop using do and dynamic

runrev at animabit.de runrev at animabit.de
Fri Jun 26 05:44:08 EDT 2009


hi, thanks for thinking!

Q: dynamic usage of regex in a repeat loop


My current status is to use the do command and the construction of the runrev command at runtime, which might slow down a little bit because it has to be done anytime.

----------------------------------------------------------------------
content of field "auftrag":

put matchText(field "original","$regex",$variablelist) into decision

content of field "eval":

([A-ZÄÖÜ]{1,3}) ([0-9,]{1,5}) ([0-9,.]+)(.*)
region, zimmerzahl,wohnfläche,preis,bemerkung

script:
-----------------------------------------------------------------------
repeat
..
try
put field "auftrag" into befehl; 
replace "$regex" with line 1 of field "eval" in befehl; 
replace "$variablelist" with line 2 of field "eval" in befehl;
do befehl
end try

.. 
end repeat

--------------------------------------------------------------------
Suggestion for improvement in next versions might be the possibility to use an array variable to get the values of the () variables in array[1] etc.
matchtext(text,regex,array)

matchtext(field "orig",regexline,resultarray)

Regards, Franz





More information about the use-livecode mailing list