[Tutor] newbie search and replace
Michael Janssen
Janssen@rz.uni-frankfurt.de
Mon Jan 27 22:16:55 2003
On Tue, 28 Jan 2003, Magnus Lycka wrote:
> But this is not the same as a regular expression word boundry.
> A word in RE is a sequence of alphanumeric characters and
> underscore. So, there are other word boundries than whitespace.
[snip]
> Once a problem reaches a certain level of complexity, and I
> think tidying natural language texts are a problem at that
> level, using too simple tools will just lead to very
> complicated, or failing, solutions. (Or both.)
>
> The power of RE means that it takes some time to learn, but
> in many situations, it's worth it.
My first concern was that many global subtitions over a long string would
last a long time. But I know: never optimize your code before the obvious
attempt has proven inefficiency (On a sidenote: my favourite programm
stucks most the runtime computing RE's where perl aequivalents have done
the job already - it's terrible subjective, but I believe python's RE
slow).
Thanks for spotting the details of regular expression's "\b".
Michael
>
>
> --
> Magnus Lycka, Thinkware AB
> Alvans vag 99, SE-907 50 UMEA, SWEDEN
> phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
> http://www.thinkware.se/ mailto:magnus@thinkware.se
>
>