Regex help?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Location: Virginia, USA
Contact:

Re: Regex help?

Post by trenatos » Fri Mar 07, 2014 10:12 am

Btw, that regex works without the field!

repeat while matchChunk( T, "(?msi)(\$(\w+=\"\w+\");)", p1start,p1End,p2Start,p2End)

Works just fine!

(I don't understand that regex, but that just means I'll spend time figuring out how it works :)
Marcus

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Location: Virginia, USA
Contact:

Re: Regex help?

Post by trenatos » Fri Mar 07, 2014 10:14 am

Thierry, I owe you a beer, thank you very much for the help with this issue :)
Marcus

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Regex help?

Post by Thierry » Fri Mar 07, 2014 10:25 am

trenatos wrote:Btw, that regex works without the field!
yes, by chance :)
Backslashing quotes in a string often breaks LC parser :(
trenatos wrote: (?msi)(\$(\w+=\"\w+\");)", p1start,p1End,p2Start,p2End)
I don't understand that regex
(?msi) -> commands to say that is case insentive,
multi-line text entry and that the dot can match a return

\$ -> well, you know
\w+ -> match any word; the + is better than the *, because we are sure that we have at least one char
and if you are not at ease with regex, better avoid the "*"

the outlet () will feed p1start,p1End
the inlet () will feed p2Start,p2End

Regards and thanks for the beer.

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”