regular expression : the dollar sign ($) work with re.match() or re.search()

Alister alister.ware at ntlworld.com
Wed Sep 26 11:47:46 EDT 2012


On Wed, 26 Sep 2012 10:48:00 +0300, Jussi Piitulainen wrote:

> iMath writes:
> 
>> I only know the dollar sign ($) will match a pattern from the end of a
>> string, but which method does it work with, re.match() or re.search()
> 
> It works with both. With re.match, the pattern has to match at the start
> of the string _and_ the $ has to match the end of the string (or a
> line); re.search scans the string until it finds a suitable start.
> 
> What was the weird character that you used as a question mark? I removed
> them because they confuse the newsreader I use.

It shows fine in my news reader, perhaps you should consider changing to 
one that works properly (btw I am using pan on a fedora 17 netbook)



-- 
Q: Why is Microsoft's Product Support a failure?
A: Because Microsoft needs a Support Group instead.



More information about the Python-list mailing list