[Tutor] search and replace

Alan Gauld alan.gauld at freenet.co.uk
Wed Mar 8 00:15:29 CET 2006

>> Specifically \W signifies a word boundary so
> Using the non-word pattern '\W' will work except in cases where we're
> right at the edge:

Sneaky! I didn't know that...

> Slightly more robust is the '\b' boundary assertion pattern:

And I never understood why there were two...

Which begs the question: under what circumstance would we prefer 
to use \W instead of \b?

I need to dig out my regex book...

Alan G.

More information about the Tutor mailing list