RE: [Pythoncard-users] regular expressions in Python
by Kevin Altis other posts by this author
Jul 8 2002 6:18PM messages near this date
Re: [Pythoncard-users] regular expressions in Python
|
RE: [Pythoncard-users] regular expressions in Python
> From: Magnus Lie Hetland [mailto:magnus@[...].org]
>
> Kevin Altis <altis@[...].com>:
> >
> > I started looking into the use of a regular expression for the
> "Match whole
> > words only" requirement for the Find and Replace dialogs. I
> thought I would
> > go ahead and list the resources I've found so far in case
> anyone else dives
> > into this. It doesn't appear that I can't simply use a word
> boundary check
> > \b pattern, so a more complex search is required. I may go
> ahead and post to
> > comp.lang.python since a Google groups search didn't turn up an answer.
>
> Hm. Can't you just use string.letters in a character class and do a
> greedy search with a negative lookback? I don't see how that could
> fail...
>
> (And why can't you rely on \b?)
Because I stupidly forgot to put an r in front of the '\b' so it got treated
as a backspace instead of a \b directive to the regular expression.
http://py-howto.sourceforge.net/regex/node13.html
Which of course I saw as soon as I posted the last message. \b looks like it
will probably work, testing it now.
ka
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
_______________________________________________
Pythoncard-users mailing list
Pythoncard-users@[...].net
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
Thread:
Kevin Altis
Magnus Lie Hetland
Kevin Altis
Kevin Altis
|