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

Jussi Piitulainen jpiitula at ling.helsinki.fi
Wed Sep 26 12:29:51 EDT 2012


Alister writes:
> 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)

I was just curious why anyone would use anything other than the ASCII
question mark as an ordinary question mark when writing in English in
a newsgroup.

The post had this:

0000520 61 72 63 68 28 29 20 20 ef bc 9f 0a
          a   r   c   h   (   )  sp  sp   o   <  us  nl

od is showing (ef bc 9f) as (o < us) but since they are not individual
characters anyway, never mind that. Google tells me (ef bc 9f) is
UTF-8 for U+FF1F FULLWIDTH QUESTION MARK, so now I basically have my
answer as to what it is, though still not as to why one would use it.

The ordinary question mark would look like this:

0000000 61 72 63 68 28 29 20 3f 0a
          a   r   c   h   (   )  sp   ?  nl



More information about the Python-list mailing list