[issue6663] re.findall does not always return a list of strings

2009-08-09 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> invalid status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue6663] re.findall does not always return a list of strings

2009-08-07 Thread Matthew Barnett
Matthew Barnett added the comment: In a regular expression (...) will group and capture, whereas (?:...) will only group and not capture. -- nosy: +mrabarnett ___ Python tracker

[issue6663] re.findall does not always return a list of strings

2009-08-07 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: You are right-- the documentation does say this, although it took me a while to understand what it means. Thanks! It seems as though there's a flaw in the design here, because there should be some mechanism for grouping elements of a regular expression

[issue6663] re.findall does not always return a list of strings

2009-08-07 Thread Alexey Shamrin
Alexey Shamrin added the comment: You've made three groups with parentheses. Just drop them: >>> re.findall('-?\d+[.]\d+|-?\d+[.]?|-?[.]\d+', 'asdf6.77.33ff9') ['6.7', '7.33', '9'] Everything is according to documentation: "If one or more groups are present in the pattern, return a list of

[issue6663] re.findall does not always return a list of strings

2009-08-06 Thread Phillip M. Feldman
New submission from Phillip M. Feldman : As per the Python documentation, the following regular expression should produce a list containing the strings '6.7', 7.33', and '9': re.findall('(-?\d+[.]\d+)|(-?\d+[.]?)|(-?[.]\d+)', 'asdf6.77.33ff9') Instead, it generates a list of tuples. Either