Escaping the Filter command's wildcards

Paul Dupuis paul at researchware.com
Wed May 22 19:26:12 EDT 2013


On 5/22/2013 5:37 PM, Mark Schonewille wrote:
> Hi Paul,
>
> This works fine for me:
>
> put replacetext("xxx?!xxx","[\?!]","")
> --> xxxxxx
>
> What exactly is the problem you're having? Could you post some of the
> code that doesn't work for you? 

it is with the filter command not the replaceText function I ran into a
problem:

If you have a variable tSource with following 3 lines:

sometext?
sometext!
sometext.

and filter tSource with "sometext?" you get all 3 lines instead of just
the one with the ? at the end.

filter tSource with "sometext[?]" filters to just the expected line, so
that is a work-around to solve what I needed to do.

I was surprised that filter tSource with "sometext\?" did NOT work
(since that would have been a valid regex pattern to filter to just the
line with the ?). However the experience made me curious as to what
other inconsistencies with the filter command folks may have uncovered.




More information about the Use-livecode mailing list