Escaping the Filter command's wildcards

Mark Schonewille m.schonewille at economy-x-talk.com
Wed May 22 17:43:13 EDT 2013


Paul,

I read your message three more times, and I think I should note that

put replacetext("xxx?!xxx","\?","")

works too: --> xxx!xxx

in addition to

put replacetext("xxx?!xxx","[\?!]","")
--> xxxxxx

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi


> On 5/22/2013 23:16, Paul Dupuis wrote:
>> The filter command in LiveCode appears to accept a regular expression
>> (using ? for a single character match, * for multiple character match,
>> [chars] and [char-char]). However, if you want to filter a container to
>> a string where you pattern contains a question mark, it does not appear
>> that you can escape the ? with \? in the pattern to have it treated as a
>> "real" question mark instead of a wild card.
>>
>> While \? does not cause ? to be treated as a question mark instead of a
>> wild card, using [?] does appear to treat it as a real character and not
>> as a wild card.
>>
>> Does any one have any knowledge of escaping the special characters
>> listed in the Dictionary? Or whether other regex special characters can
>> be used beyond those listed?
>>
>>




More information about the use-livecode mailing list