Escaping the Filter command's wildcards

Peter Haworth pete at lcsql.com
Wed May 22 21:30:29 EDT 2013


I do find it strange that filter doesn't support full regexp syntax, seems
like RunRev would have had to write special code instead of using standard
regexp libraries which they use in other commands

Shouldn't be too difficult to write a myFilter function that supports full
regexp syntax using a repeat loop and matchText but we shouldn't really
have to take the time to do that.

Pete
lcSQL Software <http://www.lcsql.com>


On Wed, May 22, 2013 at 6:07 PM, Paul Dupuis <paul at researchware.com> wrote:

> 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.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list