Regular expression to match a #

Aahz aahz at pythoncraft.com
Thu Aug 11 13:04:15 EDT 2005


In article <42fb45d7$1 at news.eftel.com>,
John Machin  <sjmachin at lexicon.net> wrote:
>
>Search for r'^something' can never be better/faster than match for 
>r'something', and with a dopey implementation of search [which Python's 
>re is NOT] it could be much worse. So please don't tell newbies to 
>search for r'^something'.

You're somehow getting mixed up in thinking that "^" is some kind of
"not" operator -- it's the start of line anchor in this context.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

The way to build large Python applications is to componentize and
loosely-couple the hell out of everything.



More information about the Python-list mailing list