Regular expression syntax, was Re: pylint, was Re: pygame - importing GL - very bad...

someone newsboost at gmail.com
Sat Jan 5 02:12:05 CET 2013


On 01/03/2013 12:39 PM, Peter Otten wrote:
> someone wrote:
>
>> On 01/03/2013 10:00 AM, Peter Otten wrote:
>>> Terry Reedy wrote:
>>>
>>>>> [a-z_][a-z0-9_]{2,30}$) - so I suppose it wants this name to end with
>>>>> [an
>>>>> underscore ?
>>>>
>>>> No, it allows underscores. As I read that re, 'rx', etc, do match. They
>>>
>>> No, it's one leading letter or underscore [a-z_] plus at least two
>>> letters, underscores or digits [a-z0-9_]{2,30}
>>
>> Ah, [a-z0-9_]{2,30} means there should be at least two characters and
>> maximum 30 characters here ?
>
> Yes. See
>
> http://docs.python.org/2/library/re.html#regular-expression-syntax

Thanks - it's on my TODO-list to learn more about how to use these 
regexps...





More information about the Python-list mailing list