Escaping the Filter command's wildcards

Paul Dupuis paul at researchware.com
Wed May 22 21:07:52 EDT 2013


On 5/22/2013 8:32 PM, Mark Schonewille wrote:
> Hi Paul,
>
> I see what you mean. You weren't looking for a solution, just for more
> trouble :-)
>
> I tried several special characters and they can all be used to filter
> lines with the same workaround. Unfortunately, many of those special
> characters have no effect, because regex isn't fully supported by the
> filter command, as Pete mentioned already. Therefore I wonder why we
> need to escape the question mark. That seems inconsistent to me.

Since ?, *, [, and ] are used as special characters, it is possible,
thought unlikely, to need to escape any or all of them in the pattern to
actually filter on those characters.

It turns out you can escape ? and * by using [?] or [*] which treats the
character in the bracket as a character to me matched rather than a
wildcard. I have not explored how it may be possible to escape the brackets

Of course, you could do some pre-processing of the source data to
replace those characters with some token that is guaranteed not to be in
the source text, then apply the filter and then replace the token(s)
with the original characters, so there are always a work-around in code.

I was mostly wondering if there was an 'undocumented' escape character
others on the list had found but no one bothered to add a not to the
dictionary for. However, I guess that is not the case.




More information about the use-livecode mailing list