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: Add a link to the regex module in re documentation
Type: enhancement Stage: resolved
Components: Documentation, Regular Expressions Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: Mariatta, anupama.srinivas.murthy, brett.cannon, docs@python, ezio.melotti, georg.brandl, malin, marco.buttu, mrabarnett, pitrou, serhiy.storchaka, tshepang
Priority: normal Keywords: easy, patch

Created on 2014-10-10 07:48 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
regex-link.patch anupama.srinivas.murthy, 2014-10-13 16:32 review
regex-link.patch anupama.srinivas.murthy, 2014-10-28 12:30 review
regex_reference.patch marco.buttu, 2017-02-07 15:34
regex_reference.patch marco.buttu, 2017-02-08 11:16
Pull Requests
URL Status Linked Edit
PR 241 merged marco.buttu, 2017-02-22 21:34
PR 316 merged Mariatta, 2017-02-26 15:29
PR 317 merged Mariatta, 2017-02-26 15:30
PR 321 merged Mariatta, 2017-02-26 15:48
Messages (17)
msg228961 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-10 07:48
The regex module is purposed as a replacement of standard re module. Of course we fix re bugs, but for now regex is more bugfree. Even after fixing all open re bugs, regex will remain more featured. It would be good to add a link to regex in re documentation (as there are links to other GUI libraries in Tkinter documentation).
msg229091 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2014-10-11 14:28
+1
msg229250 - (view) Author: anupama srinivas murthy (anupama.srinivas.murthy) * Date: 2014-10-13 16:32
I have added the link and attached the patch below. Could you review it?

Thank you
msg229253 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-10-13 16:44
"currently more bugfree and intended to replace re"

The first part is spreading FUD if not explained in more detail.  The second is probably never going to happend :(
msg230142 - (view) Author: anupama srinivas murthy (anupama.srinivas.murthy) * Date: 2014-10-28 12:30
I have modified the patch and listed the points I know. Could you review it?
msg287209 - (view) Author: Marco Buttu (marco.buttu) * Date: 2017-02-07 08:40
IMHO the reference proposed in the patch is too verbose. Adding details like what is supported and how to use some features I think is out of the scope of the reference. Moreover, if the regex module changes the features we are reporting in the reference, we'll have an outdated reference.

In addition, as Brett Cannon pointed out in msg287159, the preferred way to mention a 3rd-party library should be by adding the reference at the top of the page, as in Doc/library/urllib.request.rst:19.

I propose to just add a more concise reference, at the beginning of the page, like the following:

.. seealso:: `regex <https://pypi.python.org/pypi/regex/>`_,
   a third-party alternative regular expression module.
msg287229 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2017-02-07 11:45
I agree with Marco that it shouldn't be too verbose. I'd like to suggest that it says that it's compatible (i.e. has the same API), but with additional features.
msg287240 - (view) Author: Marco Buttu (marco.buttu) * Date: 2017-02-07 15:34
Looking at the regex module and documentation, it is not clear to me whether its API behaves exactly as the re API. In addition, being a third-party module, things can change in the future.

To be defensive, IMO it is better to write as in the Ezio comment (in the review): "mostly compatible API". I propose a shorter patch, that adds the reference at the beginning of the page (right after the module introcution).
msg287246 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2017-02-07 16:16
With the VERSION0 flag (the default behaviour), it should behave the same as the re module, and that's not going to change.
msg287250 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2017-02-07 18:24
How about "a mostly compatible API with more thorough Unicode support"? That focuses on the VERSION1 API which is a differentiator for regex.
msg287299 - (view) Author: Marco Buttu (marco.buttu) * Date: 2017-02-08 11:16
> With the VERSION0 flag (the default behaviour), it should
> behave the same as the re module, and that's not going to change.

Thanks for the clarification Matthew. However, the default version will change, as the regex PyPI page points out: "In the short term this will be VERSION0, but in the longer term it will be VERSION1." I propose a patch that integrates the Brett suggestion.
msg287362 - (view) Author: Matthew Barnett (mrabarnett) * (Python triager) Date: 2017-02-08 19:55
Ah, well, if it hasn't changed after this many years, it never will. Expect one or two changes to the text. :-)
msg287379 - (view) Author: Ma Lin (malin) * Date: 2017-02-09 02:52
How about this? Is it too long?
@Matthew Barnett, I'm animalize on your repository.

.. seealso::

    Third-party module `regex <https://pypi.python.org/pypi/regex>`_,

    is a substitute for re module, it offers some mainstream features 
    which re module lacks (Atomic grouping, Possessive quantifiers,
    Variable-length lookbehind, Recursive matching). It also has further
    Unicode support, some advanced grammars appears in other regular
    expression engines, and many facilitations.
msg290382 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-03-24 23:40
New changeset c8e20218d77c5b8c16fd76d45612ae48ca3fba91 by Mariatta in branch '2.7':
bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-321)
https://github.com/python/cpython/commit/c8e20218d77c5b8c16fd76d45612ae48ca3fba91
msg290383 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-03-24 23:40
New changeset 21c697fd1073d6ab59e2ba82ea80bc81b9c4125c by Mariatta in branch '3.5':
bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-317)
https://github.com/python/cpython/commit/21c697fd1073d6ab59e2ba82ea80bc81b9c4125c
msg290384 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-03-24 23:41
New changeset 1457984c003b1e461f8aab93bfc37fd8e42312d5 by Mariatta in branch '3.6':
bpo-22594: Add a link to the regex module in re documentation (GH-241) (GH-316)
https://github.com/python/cpython/commit/1457984c003b1e461f8aab93bfc37fd8e42312d5
msg290390 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-03-24 23:42
New changeset ed6795e46f7653e23b862efad240a93453e7df97 by Mariatta (Marco Buttu) in branch 'master':
bpo-22594: Add a link to the regex module in re documentation (GH-241)
https://github.com/python/cpython/commit/ed6795e46f7653e23b862efad240a93453e7df97
History
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66784
2017-03-24 23:42:01Mariattasetmessages: + msg290390
2017-03-24 23:41:09Mariattasetmessages: + msg290384
2017-03-24 23:40:59Mariattasetmessages: + msg290383
2017-03-24 23:40:48Mariattasetnosy: + Mariatta
messages: + msg290382
2017-02-27 14:54:48berker.peksagsetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2017-02-26 15:48:23Mariattasetpull_requests: + pull_request282
2017-02-26 15:30:05Mariattasetpull_requests: + pull_request278
2017-02-26 15:29:33Mariattasetpull_requests: + pull_request277
2017-02-23 07:57:44Mariattasetversions: + Python 3.5, Python 3.6, Python 3.7
2017-02-22 21:34:27marco.buttusetpull_requests: + pull_request204
2017-02-09 02:52:35malinsetnosy: + malin
messages: + msg287379
2017-02-08 19:55:25mrabarnettsetmessages: + msg287362
2017-02-08 11:16:23marco.buttusetfiles: + regex_reference.patch

messages: + msg287299
2017-02-07 18:24:22brett.cannonsetmessages: + msg287250
2017-02-07 16:16:35mrabarnettsetmessages: + msg287246
2017-02-07 15:34:42marco.buttusetfiles: + regex_reference.patch

messages: + msg287240
2017-02-07 11:45:32mrabarnettsetmessages: + msg287229
2017-02-07 08:40:04marco.buttusetnosy: + marco.buttu
messages: + msg287209
2017-01-30 18:40:31brett.cannonsetassignee: docs@python -> brett.cannon

nosy: + brett.cannon
2014-10-28 12:30:37anupama.srinivas.murthysetfiles: + regex-link.patch

messages: + msg230142
versions: - Python 3.4, Python 3.5
2014-10-23 20:09:54serhiy.storchakasetcomponents: + Regular Expressions
2014-10-13 16:44:30georg.brandlsetnosy: + georg.brandl
messages: + msg229253
2014-10-13 16:32:50anupama.srinivas.murthysetfiles: + regex-link.patch

nosy: + anupama.srinivas.murthy
messages: + msg229250

components: - Regular Expressions
keywords: + patch
2014-10-12 05:24:27tshepangsetnosy: + tshepang
2014-10-11 14:38:19berker.peksagsetstage: needs patch
2014-10-11 14:28:31ezio.melottisetmessages: + msg229091
2014-10-10 07:48:05serhiy.storchakacreate