Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87217 > unrolled thread

Re: Letter class in re

Started byAntoon Pardon <antoon.pardon@rece.vub.ac.be>
First post2015-03-09 16:39 +0100
Last post2015-03-09 16:39 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Letter class in re Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-03-09 16:39 +0100

#87217 — Re: Letter class in re

FromAntoon Pardon <antoon.pardon@rece.vub.ac.be>
Date2015-03-09 16:39 +0100
SubjectRe: Letter class in re
Message-ID<mailman.222.1425915597.21433.python-list@python.org>
Op 09-03-15 om 14:33 schreef Albert-Jan Roskam:
> I was going to make the same remark, but with a slightly different solution: 
> In [1]: repr(re.search("[a-zA-Z]", "é"))
> Out[1]: 'None'
>  
> In [2]: repr(re.search(u"[^\d\W_]+", u"é", re.I | re.U))
> Out[2]: '<_sre.SRE_Match object at 0x027CDB10>'
>
> "[^\d\W_]+" means something like "one or more (+) of 'not (a digit, a non-word, an underscore)'.
>
Nice, I am seriously considering this, if only because I have less trouble
understanding this. I'll run some tests to see what gives.

-- 
Antoon Pardon

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web