Regular expression to match a #

Jeff Schwab jeffrey.schwab at rcn.com
Thu Aug 11 09:23:55 EDT 2005


John Machin 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'.

How else would you match the beginning of a line in a multi-line string?



More information about the Python-list mailing list