How to match word boundary?

Peng Yu PengYu.UT at
Wed Jul 23 00:33:04 CEST 2008


I use r"\ba\b" to match "a". However, I can not use "\ba::\b" to match

I would like to match "a::" in "a::b", but not in "a:: b". That is,
the character after "::" should be a alphanumeric character. Could you
let me know how to do it and why "\b" would not work?


More information about the Python-list mailing list