On Mar 18, 2005, at 9:27 AM, Christopher Weimann wrote:

On 03/17/2005-10:15AM, Mike Hall wrote:
<applause> Very nice sir. I'm interested in what you're doing here with
the caret metacharacter. For one thing, why enclose it and the
whitespace flag within a character class?

A caret as the first charachter in a class is a negation.
So this [^\s]+ means match one or more of any char that
isn't whitespace.

Ok, so the context of metas change within a class. That makes sense, but I'm unclear on the discrepancy below.

Does this not traditionally
mean you want to strip a metacharacter of it's special meaning?


That would be \

Here's where I'm confused. From the Python docs:

Special characters are not active inside sets. For example, <x-tad-smaller>[akm$]</x-tad-smaller> will match any of the characters "<x-tad-smaller>a</x-tad-smaller>", "<x-tad-smaller>k</x-tad-smaller>", "<x-tad-smaller>m</x-tad-smaller>", or "<x-tad-smaller>$</x-tad-smaller>"
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to