Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'ascii': 0.07; 'defines': 0.07; 'expressions': 0.07; 'matches': 0.07; 'returned.': 0.07; '"a"': 0.09; 'satisfy': 0.09; 'zeros': 0.09; '"*"': 0.16; 'forth.': 0.16; 'lowercase': 0.16; 'naming': 0.16; 'nightmare': 0.16; 'somehow,': 0.16; 'space)': 0.16; 'two,': 0.16; 'uppercase': 0.16; 'zero,': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'jan': 0.18; '>>>': 0.18; '(not': 0.20; 'discussion': 0.20; 'bit': 0.21; 'names.': 0.22; 'provided,': 0.22; 'questions:': 0.22; 'defined': 0.22; 'example': 0.23; 'work.': 0.23; 'least': 0.25; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'skip:[ 10': 0.26; '(which': 0.26; 'thanks!': 0.26; 'guess': 0.27; 'found.': 0.27; 'regular': 0.27; "doesn't": 0.28; 'chris': 0.28; 'catching': 0.29; 'character.': 0.29; 'preceding': 0.29; 'second,': 0.29; 'evaluation': 0.30; 'asked': 0.33; 'like:': 0.33; 'to:addr:python-list': 0.33; 'pm,': 0.35; 'something': 0.35; 'there': 0.35; 'next': 0.35; 'but': 0.36; 'characters': 0.36; 'does': 0.37; 'busy': 0.37; 'quite': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'to:addr:python.org': 0.39; 'end': 0.40; 'think': 0.40; 'your': 0.60; 'group,': 0.60; 'range': 0.60; 'most': 0.61; 'subject:, ': 0.61; 'internet,': 0.61; 'first': 0.61; 'letters': 0.62; 'provide': 0.62; 'subject:...': 0.63; 'more': 0.63; 'gone': 0.64; 'note:': 0.64; 'total': 0.65; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'yourself': 0.77; 'satisfied': 0.83; '2013': 0.84; 'group)': 0.84; 'interesting,': 0.84; 'received:89': 0.86; 'greedy': 0.91; 'ranging': 0.91; 'subject:very': 0.91; 'luck': 0.93 Date: Sat, 05 Jan 2013 14:49:11 +0200 From: Jan Riechers User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: pylint, was Re: pygame - importing GL - very bad... References: <50e4c83b$0$30003$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: janpeterr@freenet.de List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357390320 news.xs4all.nl 6840 [2001:888:2000:d::a6]:59808 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36164 On 05.01.2013 03:11, someone wrote: > On 01/03/2013 12:27 PM, Chris Angelico wrote: >> On Thu, Jan 3, 2013 at 10:19 PM, someone wrote: >>> Doesn't this "[ ... ]" mean something optional? >>> >>> What does {2,30}$ mean? >>> >>> I think $ means that the {2,30} is something in the end of the >>> sentence... >> >> You can find regular expression primers all over the internet, but to >> answer these specific questions: [...] means any of the characters in >> the range; the $ means "end of string"; and {2,30} means at least two, >> and at most thirty, of the preceding character. So you have to have >> one from the first group, then 2-30 from the second, for a total of >> 3-31 characters in your names. > > Got it, thanks! > > Just following the discussion which is very interesting, even so when not working with OpenGL (which looks like a nightmare with that naming space) :) But about the regular expressions (a bit deeper look into that): Like said of Chris: [a-z] defines a "catching group", in this case all ascii lowercase letters ranging from "a" to "z". If noting else is provided, the rule matches one letter if there is no range defined by something like: {} -> Target a range of a match/hit There are also a ? -> Lazy match * -> Gready match [A-Z][0-9]{1,3} means translated: Look for any uppercase letter in ascii(!) (not "öäü" or similiar) ranging from "A" to "Z". Now look for any digit (2nd catching group) with the addition to satisfy the rule ONLY if there are at least 1 to 3 digits found. Note: If there are 4 or more digits - the catching rule is still satisfied and will provide a match/hit. If there is a follow up group, the next evaluation is gone through if present and so forth. If the expression is satisfied, the match is returned. The lazy "?" and greedy "*" matches try to satisfy, as the naming implies, to match as less or as much of what you have asked for. For example the regular expression is valid: 0* -> Look for a zero, and be greedy as of how many zeros you want match which might follow. Regular expressions don't have to include catching groups in order to work. But when you use them yourself somehow, its quite simple I think. I guess you are anyhow busy mangling with pyLint, PEP-Standards and pyOpenGL - so good luck with that :) Jan Riechers