How do I parse this ? regexp ? [slighly OT]

Jeremy Bowers jerf at jerf.org
Thu Apr 28 22:44:36 EDT 2005


On Thu, 28 Apr 2005 20:53:14 -0400, Peter Hansen wrote:
> The re docs clearly say this is not the case:
> 
> '''
> []
>      Used to indicate a set of characters. Characters can be listed
> individually, or a range of characters can be indicated by giving two
> characters and separating them by a "-". Special characters are not active
> inside sets.
> '''
> 
> Note the last sentence in the above quotation...
> 
> -Peter

Aren't regexes /fun/?

Also from that passage, Simon, note the "-" right in front of 
[-\[\]0-9,. ], another one that's tripped me up more than once.

Wheeee!

"Some people, when confronted with a problem, think ``I know, I'll use
regular expressions.'' Now they have two problems." - jwz
http://www.jwz.org/hacks/marginal.html




More information about the Python-list mailing list