[issue12162] Documentation about re \number

2013-10-06 Thread Georg Brandl
Georg Brandl added the comment: I can't see the issue here. The RE docs are much better off with the regexes unquoted. The '(.+) \1' example was fixed today (the string supposed to not match actually did match). -- nosy: +georg.brandl resolution: -> works for me status: open -> clos

[issue12162] Documentation about re \number

2011-05-29 Thread R. David Murray
R. David Murray added the comment: The fact that you have carefully think about which are escapes and which aren't tells you that you should not be depending on the non-escapes not being escapes. What if we added one? The doc says preserving the \s is a debugging aid, and that is all it sho

[issue12162] Documentation about re \number

2011-05-28 Thread Ezio Melotti
Ezio Melotti added the comment: The regex sets (\d\w\s\D\W\S) don't match any Python escape sequence, so even if some suggest to always use r'' regardless, I don't find it necessary, especially for simple regexs. The two conflicting escape sequences to keep in mind are \b (backspace for Pytho

[issue12162] Documentation about re \number

2011-05-28 Thread R. David Murray
R. David Murray added the comment: Why it works is due to a quirk in the handling of python strings: if an apparent escape sequence doesn't "mean anything", it is retained verbatim, including the '\' character. This is documented in http://docs.python.org/reference/lexical_analysis.html#stri

[issue12162] Documentation about re \number

2011-05-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: The doc consistently does NOT quote re's in the text. Rather, they are shaded gray, both in Windows help version and html version. So this one should not be treated differently. Most of the confusion reported is due to not reading the intro paragraphs. I alm

[issue12162] Documentation about re \number

2011-05-23 Thread Seth Troisi
Seth Troisi added the comment: Given David Murray's input I think the example would be best done as >>> re.search(r'(\w+) \1', "can you do the can can?") # Matches the duplicate >>> can <_sre.SRE_Match object at ...> I want to stress that the documentation is not wrong but confusing, especi

[issue12162] Documentation about re \number

2011-05-23 Thread R. David Murray
R. David Murray added the comment: Read the description of strings and raw strings at the top of the re documentation for the answer to your question about \\. It would probably be better if the example regular expression was written r'(.+) \1' instead of as a bare expression as it is now.

[issue12162] Documentation about re \number

2011-05-23 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12162] Documentation about re \number

2011-05-23 Thread Seth Troisi
New submission from Seth Troisi : It would be nice to clarify re documentation on how to use \number. current documentation lists three half examples: "(.+) \1 matches 'the the' or '55 55', but not 'the end' (note the space after the group)." This is rather confusing (at least to me) as it mig