[Coldstuff] regexp revisited
Bruce Mitchener
coldstuff@cold.org
Mon, 18 Mar 2002 14:29:32 -0700
Adam Cormany wrote:
> A few months ago I asked for help on a regexp issue I
> was having. Brandon attempted to help and had my
> problem 90% corrected, but I'm still running into
> problems with it. Hopefully this time I can get it
> solved for good:)
>
> I want to check a string for "{" or "{a", "{b", "{c"
> .. "{z", but I don't want to find "{a}", "{b}", "{c}"
> .. "{z}". How can I achieve this on cold with its
> regexp? Or is there a better way of doing this?
If I couldn't get that to work directly, I'd probably take an approach
using $string.global_regexp() (poor name) to divide the original string
into fragments where the odd fragments don't match the regexp and the
even ones do. Then you'd know that you need to process the odd ones to
do the replace of { with \{.
It sucks more, is less efficient, etc. But it also works. :)
- Bruce