Page 1 of 1
More regex examples in documentation
Posted: Mon Jul 29, 2013 5:04 pm
by edgore
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.
Re: More regex examples in documentation
Posted: Fri Aug 23, 2013 12:36 pm
by BvG
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!
Re: More regex examples in documentation
Posted: Mon Aug 26, 2013 5:06 am
by mwieder
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.
Re: More regex examples in documentation
Posted: Mon Aug 26, 2013 3:51 pm
by edgore
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.
Re: More regex examples in documentation
Posted: Mon Aug 26, 2013 4:52 pm
by mwieder
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.
Re: More regex examples in documentation
Posted: Tue Aug 27, 2013 4:39 pm
by edgore
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.