More regex examples in documentation

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

More regex examples in documentation

Post by edgore » Mon Jul 29, 2013 5:04 pm

When the documentation gets updates can we got more examples in the replace text command that show more complicated expressions that use all the funky characters and stuff? regular expressions are impenetrable to me, and it would be useful to have more livecode examples to work from when trying to figure out how to translate the perl examples I find on the web.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: More regex examples in documentation

Post by BvG » Fri Aug 23, 2013 12:36 pm

Regular expressions are a kind of industrial norm, and there's whole books written on them. Personally, I don't think the dictionary is the right place for a through explanation on all it's uses :)

Just use google to find regexp tutorials!
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: More regex examples in documentation

Post by mwieder » Mon Aug 26, 2013 5:06 am

LOL. I usually regard regex as a write-only language.
But perl uses the same pcre library LiveCode does, so the examples should work as long as you translate the perl keywords into LiveCode statments.

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

Re: More regex examples in documentation

Post by edgore » Mon Aug 26, 2013 3:51 pm

I seem to run into problems when I have to escape special characters - that is what I would like to see some livecode examples of - the examples that are in the dictionary today are very basic. I know...I should probably write my regex in a text file and merge it into a variable and use that, but it would be nice to have a couple of examples that go beyond using a single word in the search.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: More regex examples in documentation

Post by mwieder » Mon Aug 26, 2013 4:52 pm

Whenever I'm dealing with regex, I go to one of the online regex test sites (googling for regex test should bring up half a dozen or so good online testers, and then massage the regex string against a test string until it works. Then I'm ready to paste the regex into my code.

But point taken about more regex examples. I'll see if I can take that one on.

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

Re: More regex examples in documentation

Post by edgore » Tue Aug 27, 2013 4:39 pm

That's a great suggestion about using a test/validator site - I have been doing that for SQL, but it never occurred to me to look for one for regex.

Looking around I have also run across this - http://txt2re.com which is a regex generator that might be useful for some.

Post Reply