[issue10539] Regular expression not checking 'range' element on 1st char in string.
New submission from Jamie Murray txr...@gmail.com: The first char in a word is omitted from being checked against the 'range' element of the 1st part of this expression. The second char is properly checked to see if it's in range # Desired safe string to expect goodString = f42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 # Test string to return False if it's not within reg ex range. # but still returns a false positive even though the g at the start is outside of a-f range. badString = g42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 # 2nd test string which does return a false result correctly. otherBadString = fg2e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 See attached file for example. Python 2.5.4 (r254:67916, Dec 23 2008, 15:19:34) [MSC v.1400 64 bit (AMD64)] on win32 -- components: Regular Expressions files: RegExPyBug.py messages: 122461 nosy: TxRxFx priority: normal severity: normal status: open title: Regular expression not checking 'range' element on 1st char in string. type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file19823/RegExPyBug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10539] Regular expression not checking 'range' element on 1st char in string.
Eric Smith e...@trueblade.com added the comment: I'm not sure I understand. The output I get is: f42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 g42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 False The first string matches. The second string matches because the leading g is being matched by \w. The third string does not match because the g in the second position is not matched by [0-9][a-f]. For the second string you're matching \w followed by 7 [0-9][a-f], just as the regex allows. Am I missing something? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10539] Regular expression not checking 'range' element on 1st char in string.
Georg Brandl ge...@python.org added the comment: I don't think so; closing as invalid. -- nosy: +georg.brandl resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10539] Regular expression not checking 'range' element on 1st char in string.
Jamie Murray txr...@gmail.com added the comment: Apologies, sincere and most humble apolgies doh! On 26 Nov 2010 18:51, Georg Brandl rep...@bugs.python.org wrote: Georg Brandl ge...@python.org added the comment: I don't think so; closing as invalid. -- nosy: +georg.brandl resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10539 ___ -- Added file: http://bugs.python.org/file19829/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10539 ___pApologies, sincere and most humble apolgies doh!/p div class=gmail_quoteOn 26 Nov 2010 18:51, quot;Georg Brandlquot; lt;a href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt; wrote:br type=attributiongt; brgt; Georg Brandl lt;a href=mailto:ge...@python.org;ge...@python.org/agt; added the comment:br gt; brgt; I don#39;t think so; closing as invalid.brgt; brgt; --brgt; nosy: +georg.brandlbrgt; resolution: -gt; invalidbrgt; status: open -gt; closedbrgt; brgt; ___br gt; Python tracker lt;a href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;brgt; lt;a href=http://bugs.python.org/issue10539;http://bugs.python.org/issue10539/agt;brgt; ___br /div ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com