[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Cristian for reporting this issue. Thank you Mandeep for your patch. 
Thank you Mariatta for merging.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks everyone. I merged the PR, and it's been backported to 3.6 and 2.7

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 3e60747025edc34b503397ab8211be59cfdd05cd by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) 
(GH-4554)
https://github.com/python/cpython/commit/3e60747025edc34b503397ab8211be59cfdd05cd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset c02037d62284f4d4ca6b22f2ed05165ce2014951 by Mariatta (Miss 
Islington (bot)) in branch '2.7':
bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) 
(GH-4555)
https://github.com/python/cpython/commit/c02037d62284f4d4ca6b22f2ed05165ce2014951


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4486

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4485

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-24 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 610e5afdcbe3eca906ef32f4e0364e20e1b1ad23 by Mariatta (Mandeep 
Bhutani) in branch 'master':
bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443)
https://github.com/python/cpython/commit/610e5afdcbe3eca906ef32f4e0364e20e1b1ad23


--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-17 Thread Mandeep Bhutani

Mandeep Bhutani  added the comment:

Cristian, Serhiy: I've submitted a PR for this bug. 

Cristian: I apologize for misspelling your name in a prior post.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-17 Thread Mandeep Bhutani

Change by Mandeep Bhutani :


--
keywords: +patch
pull_requests: +4384
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-17 Thread Mandeep Bhutani

Mandeep Bhutani  added the comment:

Serhiy, Christian: I'll submit a PR for this later today.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-17 Thread Cristian Barbarosie

Cristian Barbarosie  added the comment:

I'm sorry, I have no experience at all with Git. Could you please do it for me ?
The bug appears in two places, see my first two messages.
Thank you

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Do you mind to create a pull request on GitHub Cristian?

--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett, serhiy.storchaka
stage:  -> needs patch
versions:  -Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-05-04 Thread Cristian Barbarosie

Cristian Barbarosie added the comment:

This topic seems stuck. Is there anything else I should do ?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-04-27 Thread Mandeep Bhutani

Mandeep Bhutani added the comment:

Looks like both examples need a closing \b. Is this being worked on or should I 
submit a PR?

--
nosy: +mandeepb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-04-06 Thread Cristian Barbarosie

Cristian Barbarosie added the comment:

Just discovered that a nearly identical example is presented in the end of 
section "Non-capturing and Named Groups". My proposal applies to this other 
example, too.
And, by the way, reading this HOWTO has been very useful to me.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +akuchling

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30004] in regex-howto, improve example on grouping

2017-04-05 Thread Cristian Barbarosie

New submission from Cristian Barbarosie:

In the Regular Expression HOWTO
https://docs.python.org/3.6/howto/regex.html#regex-howto
the last example in the "Grouping" section has a bug. The code is supposed to 
find repeated words, but it catches false repetitions.

>>> p = re.compile(r'(\b\w+)\s+\1')
>>> p.search('Paris in the the spring').group()
'the the'
>>> p.search('k is the thermal coefficient').group()
'the the'

I propose adding a \b after \1, this solves the problem :

>>> p = re.compile(r'(\b\w+)\s+\1\b')
>>> p.search('Paris in the the spring').group()
'the the'
>>> print p.search('k is the thermal coefficient')
None

--
assignee: docs@python
components: Documentation
messages: 291209
nosy: Cristian Barbarosie, docs@python
priority: normal
severity: normal
status: open
title: in regex-howto, improve example on grouping
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com