[cl-ppcre-devel] searching backward?

Shawn Betts sabetts at vcn.bc.ca
Fri Feb 16 14:19:42 UTC 2007


Edi Weitz <edi at agharta.de> writes:

> No, there's no such thing as a :FROM-END keyword argument or the
> equivalent, and I'm also not aware of a regex facility in another
> programming language which has that.

Emacs does it somehow.

> If you really need it, you could loop through the string applying
> SCAN until it matches with decreasing values for START, but that
> could be quite inefficient, of course. An alternative would be to
> work on (REVERSE TARGET) instead of TARGET, but you'll have to think
> hard how your regular expression should look like in that case - the
> semantics of things like "*" will certainly be different.

I was afaid you'd say that :). I guess I'll look closer into how emacs
does it.

Thanks!

-Shawn



More information about the Cl-ppcre-devel mailing list