This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve re documentation
Type: enhancement Stage: resolved
Components: Documentation, Regular Expressions Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Brian Ward, akuchling, barry, cryvate, docs@python, ezio.melotti, gregory.p.smith, mrabarnett, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-10-06 14:22 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3907 merged serhiy.storchaka, 2017-10-06 14:24
PR 3994 merged serhiy.storchaka, 2017-10-14 08:42
Messages (7)
msg303822 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-06 14:22
The proposed PR improves the documentation of re module and Regular Expression HOWTO.

* Clarify the effect of the LOCALE flag.

* Remove outdated statements.

* Add an example of escaping a replacement string.

* Add or correct some references.

* Improve and fix a formatting.
msg303825 - (view) Author: Henk-Jaap Wagenaar (cryvate) * Date: 2017-10-06 15:11
I was looking at your changes and got myself in a muddle. What is you rational for when you use ``[character or string]`` versus ``'[character or string]``? You seem to be creating consistency there, but I cannot quite see the rules you are aiming for!
msg303826 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2017-10-06 15:19
ISTM that ``x`` is used when x is a regex or regex metachar, whereas ``'x'`` is used when 'x' is a string.  I find this distinction reasonable.
msg303829 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-06 15:40
It is explained in the documentation:

"""
(In the rest of this
section, we'll write RE's in ``this special style``, usually without quotes, and
strings to be matched ``'in single quotes'``.)
"""
msg303833 - (view) Author: Brian Ward (Brian Ward) * Date: 2017-10-06 16:00
In re.rst, the instances of "Correcsponds the" should be "Corresponds to the" and "Doesn't have correcsponding inline flag" should be "No corresponding inline flag."
msg304387 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-14 08:14
New changeset cd195e2a7ac5c9b2574d5462752b7939641de4a9 by Serhiy Storchaka in branch 'master':
bpo-31714: Improved regular expression documentation. (#3907)
https://github.com/python/cpython/commit/cd195e2a7ac5c9b2574d5462752b7939641de4a9
msg304390 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-14 09:17
New changeset 69ed5b61e7d2bdaf2dc6684061f737adc24a96ae by Serhiy Storchaka in branch '3.6':
[3.6] bpo-31714: Improved regular expression documentation. (GH-3907). (#3994)
https://github.com/python/cpython/commit/69ed5b61e7d2bdaf2dc6684061f737adc24a96ae
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 75895
2017-11-16 13:25:52serhiy.storchakalinkissue30133 superseder
2017-10-14 09:26:57serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-10-14 09:17:21serhiy.storchakasetmessages: + msg304390
2017-10-14 08:42:46serhiy.storchakasetpull_requests: + pull_request3970
2017-10-14 08:14:32serhiy.storchakasetmessages: + msg304387
2017-10-06 16:00:34Brian Wardsetnosy: + Brian Ward
messages: + msg303833
2017-10-06 15:40:34serhiy.storchakasetmessages: + msg303829
2017-10-06 15:19:35ezio.melottisetmessages: + msg303826
2017-10-06 15:11:22cryvatesetnosy: + cryvate
messages: + msg303825
2017-10-06 15:05:28serhiy.storchakasetnosy: + gregory.p.smith
2017-10-06 14:24:31serhiy.storchakasetkeywords: + patch
pull_requests: + pull_request3878
2017-10-06 14:22:12serhiy.storchakacreate