[issue6156] Error compiling valid regex

2017-11-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue was fixed in issue9179. The issue with 65535 repeats was fixed in issue13169. -- nosy: +serhiy.storchaka ___ Python tracker

[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

[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 ___

[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 ___

[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

[issue30148] Pathological regex behaviour

2017-11-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker

[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

[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-10-11 Thread Berker Peksag
Change by Berker Peksag : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your reviews. Currently the caching logic is simpler, it no longer depends on the LOCALE flag and the current locale. But it still is too complex for lru_cache. It needs a way to bypass caching based on arguments or result. --

[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 114454e9f6addbcb364e9a37102c8131ae2da1dd by Serhiy Storchaka in branch 'master': bpo-28293: Don't completely dump the regex cache when full. (#3768) https://github.com/python/cpython/commit/114454e9f6addbcb364e9a37102c8131ae2da1dd

[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +barry ___ Python tracker ___ ___

[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +3753 ___ Python tracker ___

[issue2636] Adding a new regex module (compatible with re)

2017-07-25 Thread Jonathan Halcrow
Changes by Jonathan Halcrow : -- nosy: -jhalcrow ___ Python tracker ___ ___

[issue2636] Adding a new regex module (compatible with re)

2017-07-23 Thread Socob
Changes by Socob <206a8...@opayq.com>: -- nosy: +Socob ___ Python tracker ___ ___ Python-bugs-list mailing

Re: Better Regex and exception handling for this small code

2017-07-18 Thread Ganesh Pal
tiator_crc = b6b20a65, >> journal_crc = d2097b00 >> Note: Task completed successfully. >> Note: CRC:algo = 2, split_crc = 1, unused = 0, initiator_crc = d976d35e, >> journal_crc = a176af10 >> >> >> I have the below piece of code but would like to make this

Re: Better Regex and exception handling for this small code

2017-07-12 Thread MRAB
have the below piece of code but would like to make this better more pythonic , I found regex pattern and exception handling poor here , any quick suggestion in your spare time is welcome. #open the existing file if the flag is set and check if there is a match log_file='/file.txt' flag_is_on=1

Re: Better Regex and exception handling for this small code

2017-07-12 Thread Nick Mellor
> journal_crc = a176af10 > > > I have the below piece of code but would like to make this better more > pythonic , I found regex pattern and exception handling poor here , any > quick suggestion in your spare time is welcome. > > > #open the existing file if t

Re: Better Regex and exception handling for this small code

2017-07-11 Thread Cameron Simpson
better more pythonic , I found regex pattern and exception handling poor here , any quick suggestion in your spare time is welcome. #open the existing file if the flag is set and check if there is a match log_file='/file.txt' flag_is_on=1 Use "True" instead of "1". A flag is a

Re: Better Regex and exception handling for this small code

2017-07-11 Thread Ganesh Pal
rnal_crc = d2097b00 > Note: Task completed successfully. > Note: CRC:algo = 2, split_crc = 1, unused = 0, initiator_crc = d976d35e, > journal_crc = a176af10 > > > I have the below piece of code but would like to make this better more > pythonic , I found regex pattern and exception

Better Regex and exception handling for this small code

2017-07-11 Thread Ganesh Pal
= 0, initiator_crc = b6b20a65, journal_crc = d2097b00 Note: Task completed successfully. Note: CRC:algo = 2, split_crc = 1, unused = 0, initiator_crc = d976d35e, journal_crc = a176af10 I have the below piece of code but would like to make this better more pythonic , I found regex pattern

[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-06-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Serhiy that the docs correctly and completely describe the behavior. -- nosy: +rhettinger status: pending -> open ___ Python tracker

[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-06-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >From the documentation: """ As the target string is scanned, REs separated by ``'|'`` are tried from left to right. When one pattern completely matches, that branch is accepted. This means that once ``A`` matches, ``B`` will not be tested further, even if

[issue26336] Expose regex bytecode of compiled pattern object

2017-05-07 Thread Terry J. Reedy
ved status: open -> closed title: Expose regex bytecode as attribute of compiled pattern object -> Expose regex bytecode of compiled pattern object versions: +Python 3.7 -Python 3.6 ___ Python tracker <rep...@bugs.python.org&

[issue26336] Expose regex bytecode as attribute of compiled pattern object

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue30299 which adds the output of decoded bytecode in debug mode. The format of the bytecode is implementation detail, it is irregular, new opcodes can be added, and the format of existing opcodes can be changed. Thus it is hard to support third-party

[issue12870] Regex object should have introspection methods

2017-05-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[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 ___

[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

[issue30187] Regex becomes invalid in python 3.6

2017-04-27 Thread Chris Seto
Chris Seto added the comment: Thank you for pointing that out to me! -- ___ Python tracker ___ ___

[issue30187] Regex becomes invalid in python 3.6

2017-04-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is ambiguous syntax. Unknown escapes consisting of '\' and ASCII letter were deprecated in 3.5 (run the interpreter with the option -Wa to see all warnings) and are errors since 3.6. Note that the string literal '[^\B]' itself produces a

[issue30187] Regex becomes invalid in python 3.6

2017-04-27 Thread Chris Seto
_parse.py", line 526, in _parse code1 = _class_escape(source, this) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 336, in _class_escape raise source.error('bad escape %s' % escape, len(escape)) sre_constants.error: bad escape \B at position 2 ---

[issue30157] csv.Sniffer.sniff() regex error

2017-04-27 Thread Jake Davis
Jake Davis added the comment: I've added some unittests for Sniffer._guess_quote_and_delimiter(); they should prevent regression. -- ___ Python tracker

[issue30157] csv.Sniffer.sniff() regex error

2017-04-25 Thread Jake Davis
Jake Davis added the comment: Will do! I will try to get a regression proof test into test_csv.py in the next 24 hours. Essentially I will make sure that the sniffer returns a positive match for each of the patterns that the regex is intended to hit

[issue30157] csv.Sniffer.sniff() regex error

2017-04-25 Thread R. David Murray
R. David Murray added the comment: If it is a bug that indicates there is at least one missing unit test :) Maybe the OP will contribute a test. -- nosy: +r.david.murray ___ Python tracker

[issue30157] csv.Sniffer.sniff() regex error

2017-04-25 Thread STINNER Victor
STINNER Victor added the comment: Can you please try to write a unit test to check for non-regression? Or at least give an example? -- ___ Python tracker

[issue30157] csv.Sniffer.sniff() regex error

2017-04-25 Thread Matthew Barnett
Matthew Barnett added the comment: There are 4 patterns. They try to determine the delimiter and quote by looking for matches. Each pattern supposedly covers one of 4 cases: 1. Delimiter, quote, value, quote, delimiter. 2. Start of line/text, quote, value, quote, delimiter. 3. Delimiter,

[issue30157] csv.Sniffer.sniff() regex error

2017-04-25 Thread STINNER Victor
STINNER Victor added the comment: What is the consequence of this change? Does it change the syntax of the parser? Which kind of format wasn't parsed correctly? -- nosy: +haypo ___ Python tracker

[issue30157] csv.Sniffer.sniff() regex error

2017-04-24 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- title: csn.Sniffer.sniff() regex error -> csv.Sniffer.sniff() regex error ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30157] csn.Sniffer.sniff() regex error

2017-04-24 Thread Jake Davis
New submission from Jake Davis: Line 220 of Lib/csv.py has an extra `>` in the first group: r'(?P>[^\w\n"\']) -- components: Library (Lib) messages: 292249 nosy: jcdavis1983 priority: normal pull_requests: 1389 severity: normal status: open title: csn.Sniffer.sniff()

[issue30148] Pathological regex behaviour

2017-04-24 Thread Tim Peters
Tim Peters added the comment: Yes, that example takes time exponential in the number of blanks to (fail to) match - each time you add a blank to `input`, it essentially doubles the time required. It's _possible_ for an implementation to deduce that `(\s+)+` is an insanely inefficient way to

[issue30148] Pathological regex behaviour

2017-04-24 Thread Jussi Pakkanen
Jussi Pakkanen added the comment: This is slow even when ignores is set to a non-empty value. It's not as slow but the real slowdown is in the whitespace regex. Here is a minimal sample: input = ' abc' re.search(r'(\s+)+d', input

[issue30148] Pathological regex behaviour

2017-04-23 Thread Matthew Barnett
Matthew Barnett added the comment: If 'ignores' is '', you get this: (?:\b(?:extern|G_INLINE_FUNC|%s)\s*) which can match an empty string, and it's tried repeatedly. That's inadvisable. There's also: (?:\s+|\*)+ which can match whitespace in multiple ways. That's inadvisable too.

[issue30148] Pathological regex behaviour

2017-04-23 Thread Jussi Pakkanen
New submission from Jussi Pakkanen: Attached is a script that runs a single regex against one line of text taking over 12 seconds. If you run the exact same regex in Perl it finishes immediately. The slowness has something to do with spaces. If you replace consecutive spaces in the input

[issue10076] Regex objects became uncopyable in 2.5

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue10076] Regex objects became uncopyable in 2.5

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset fdbd01151dbd5feea3e4c0316d102db3d2a2a412 by Serhiy Storchaka in branch 'master': bpo-10076: Compiled regular expression and match objects now are copyable. (#1000)

[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. --

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

2017-04-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +akuchling ___ Python tracker ___ ___

[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.

[issue10076] Regex objects became uncopyable in 2.5

2017-04-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1173 ___ Python tracker ___ ___

[issue10076] Regex objects became uncopyable in 2.5

2017-04-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since the pattern and the match objects can be considered as immutable, it is worth to implement __copy__ and __deepcopy__ returning the object itself. Proposed PR does this. It also fixes signatures of __deepcopy__ methods. Since copying didn't work in all

[issue22594] Add a link to the regex module in re documentation

2017-03-24 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: 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

[issue22594] Add a link to the regex module in re documentation

2017-03-24 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: 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

[issue22594] Add a link to the regex module in re documentation

2017-03-24 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: 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

[issue22594] Add a link to the regex module in re documentation

2017-03-24 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: 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

Re: How to search out all Zip codes and replace with the first 2 digits, in a Pandas dataframe, with the use of regex?

2017-03-22 Thread Irving Duran
<pre>You can do the following df['field'] = df.replace(r'(?<![\d])(\d{2})', '', regex=True) Thank You, Irving Duran On Mon, Mar 20, 2017 at 9:53 AM, David Shi via Python-list < python-list@python.org> wrote: > Hi, there, > Can anyone help? > How to search out a

How to search out all Zip codes and replace with the first 2 digits, in a Pandas dataframe, with the use of regex?

2017-03-20 Thread David Shi via Python-list
Hi, there, Can anyone help? How to search out all Zip codes and replace with the first 2 digits, in a Pandas dataframe, with the use of regex? For instance, a ZIP code 33132 was found and replaced with 33. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman

[issue22594] Add a link to the regex module in re documentation

2017-02-27 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue22594] Add a link to the regex module in re documentation

2017-02-26 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +282 ___ Python tracker ___ ___

[issue22594] Add a link to the regex module in re documentation

2017-02-26 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +278 ___ Python tracker ___ ___

[issue22594] Add a link to the regex module in re documentation

2017-02-26 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +277 ___ Python tracker ___ ___

[issue22594] Add a link to the regex module in re documentation

2017-02-22 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

[issue22594] Add a link to the regex module in re documentation

2017-02-22 Thread Marco Buttu
Changes by Marco Buttu : -- pull_requests: +204 ___ Python tracker ___ ___

[issue22594] Add a link to the regex module in re documentation

2017-02-08 Thread Ma Lin
Ma Lin added the comment: 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

[issue22594] Add a link to the regex module in re documentation

2017-02-08 Thread Matthew Barnett
Matthew Barnett added the comment: Ah, well, if it hasn't changed after this many years, it never will. Expect one or two changes to the text. :-) -- ___ Python tracker

[issue22594] Add a link to the regex module in re documentation

2017-02-08 Thread Marco Buttu
Marco Buttu added the comment: > 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

[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Brett Cannon
Brett Cannon added the comment: How about "a mostly compatible API with more thorough Unicode support"? That focuses on the VERSION1 API which is a differentiator for regex. -- ___ Python tracker <rep...@bugs.python.org> <htt

[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Matthew Barnett
Matthew Barnett added the comment: With the VERSION0 flag (the default behaviour), it should behave the same as the re module, and that's not going to change. -- ___ Python tracker

[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Marco Buttu
Marco Buttu added the comment: 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

[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Matthew Barnett
Matthew Barnett added the comment: 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. -- ___ Python tracker

[issue22594] Add a link to the regex module in re documentation

2017-02-07 Thread Marco Buttu
Marco Buttu added the comment: 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

[issue22594] Add a link to the regex module in re documentation

2017-01-30 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: docs@python -> brett.cannon nosy: +brett.cannon ___ Python tracker ___

[issue29388] regex mismatch in the simple cases

2017-01-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: re.match only matches at the start of the string. If you use re.search instead, you will get the results you are expecting. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed

[issue29388] regex mismatch in the simple cases

2017-01-29 Thread MaxR
his patterns on the site regex101.com and all of them should work good and right It's achtung! -- components: Regular Expressions messages: 286464 nosy: MaxR, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: regex mismatch in the simple cases type: behavior versions:

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2017-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > So I use "ls Lib/test/test_*codec*py", the list is quite list, it's annoying > to have to copy/paste test names manually. I would use ./python -m test --list | grep codec | xargs ./python -m test -- ___

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2017-01-02 Thread STINNER Victor
STINNER Victor added the comment: > I don't understand the use case of it ;) When I modify a codec or something related to text codecs, I would like to run all codec tests, not the fully Python test suite. So I use "ls Lib/test/test_*codec*py", the list is quite list, it's annoying to have to

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2017-01-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset a9fe5bee892b by Victor Stinner in branch 'default': Issue #29035: Simplify a regex in libregrtest https://hg.python.org/cpython/rev/a9fe5bee892b -- nosy: +python-dev ___ Python tracker <

[issue28293] Don't completely dump the regex cache when full

2016-12-24 Thread INADA Naoki
INADA Naoki added the comment: LGTM for re_cache_ordered_dict_popitem.patch -- nosy: +inada.naoki ___ Python tracker ___

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2016-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > --fromfile is written for developers who understand what they do, it's > just an helper. I don't understand the use case of it ;) , but when you need it, the patch LGTM. You can call just .group() instead of .group(0). --

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2016-12-21 Thread STINNER Victor
STINNER Victor added the comment: Ah right, "Lib/ctypes/test/test_anon.py" doesn't work. I don't think that it's worth to support running directly such test. I don't think that it's worth it to modify the regex to exclude this case. --fromfile is written for developers who under

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2016-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Reading file names from a file looks misleading. $ ls Lib/ctypes/test/*.py > list $ head list Lib/ctypes/test/__init__.py Lib/ctypes/test/__main__.py Lib/ctypes/test/test_anon.py Lib/ctypes/test/test_array_in_pointer.py Lib/ctypes/test/test_arrays.py

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2016-12-21 Thread STINNER Victor
STINNER Victor added the comment: FYI initially my idea was to use a very strict to avoid false positives. But when I used the feature, I found that the regex is more annoying than helping (ex: I had to modify the regex to accept filenames with directories). So I now prefer to use a very

[issue29035] regrtest: simplify regex to match test names for the --fromfile option

2016-12-21 Thread STINNER Victor
New submission from STINNER Victor: Lib/test/libregrtest/main.py uses a complex regex to find "test_builtin" in lines like '0:00:00 [ 4/400] test_builtin -- test_dict took 1 sec'. Recently, I changed (change d8222c197831) the regex to support a filename containing a list of

[issue28293] Don't completely dump the regex cache when full

2016-10-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: -Python 3.6 ___ Python tracker ___

ReGex with python

2016-10-21 Thread ...
Hi, I have a problem I could not solve, ask for your cooperation. "show_app_install": true, "static_root": "//instagramstatic-a.akamaihd.net/h1", "platform": "web", "activity_counts": null, "hostname": "www.instagram.com", "entry_data": {"PostPage": [{"media": {"caption_is_edited": false,

[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: re_cache_ordered_dict_popitem.patch: LGTM, it can be pushed to the default branch. -- "This is unlikely possible with current API of lru_cache. Testing flags before looking up in a cache adds an overhead." Oh wait, I looked at the code and this case is

[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is unlikely possible with current API of lru_cache. Testing flags before looking up in a cache adds an overhead. -- ___ Python tracker

[issue26436] Add the regex-dna benchmark

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: The performance project is now hosted on GitHub. I created a pull request from Serhiy's patch: https://github.com/python/performance/pull/17 So I now close this issue. Let's continue the discussion there. -- resolution: -> third party status: open ->

[issue26436] Add the regex-dna benchmark

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: I created https://github.com/python/performance/issues/15 -- ___ Python tracker ___

[issue28293] Don't completely dump the regex cache when full

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: Can't we redesign the function to reuse @functools.lru_cache(_MAXCACHE) but take care of the debug flag? For example, split the function in smaller parts. -- nosy: +haypo ___ Python tracker

[issue28461] Replacement of re with the regex package

2016-10-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue12734 for adding the support of properties in re. See issue2636 for replacing re with regex. See issue22594 for encouraging the use of regex. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -&g

[issue28461] Replacement of re with the regex package

2016-10-17 Thread Pierre Nugues
New submission from Pierre Nugues: I am using Unicode regexes in the form of properties: \p{} and these are not standard in the re module. I have to use the new regex module, which has to be installed separately. I would like to see the replacement of re with regex in the future Python

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Matthew Barnett
Matthew Barnett added the comment: I'd prefer an explicit suppression to changing a long-standing behaviour. -- ___ Python tracker ___

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Ned Deily
Ned Deily added the comment: How do others feel about Serhiy's proposal for eventually changing the semantics of groupdict() to mean only return matched groups? If that seems reasonable, then there is the separate question of how to make the transition. Adding a somewhat unpredictable

[issue28293] Don't completely dump the regex cache when full

2016-10-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> serhiy.storchaka ___ Python tracker ___

[issue23532] add example of 'first match wins' to regex "|" documentation?

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions type: behavior -> enhancement versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue26436] Add the regex-dna benchmark

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker ___

[issue28293] Don't completely dump the regex cache when full

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker ___

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes groupdict() without argument emitting FutureWarning if the result includes unmatched groups. Maybe warning message and the documentation could be better. Ned, I ask your permission for including this change in 3.6. Yes, it can break

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe start emitting FutureWarning when groupdict() is called without an argument? groupdict(None) returns the same result but without a warning. After 1 or 2 releases the behavior can be changed: groupdict() will return only matched groups. --

Re: Newbie Need Help On Regex!

2016-10-10 Thread breamoreboy
On Monday, October 10, 2016 at 3:58:56 PM UTC+1, infos...@gmail.com wrote: > Hey guys! > > I am new to learning regex in python and I'm wondering how do I use regex in > python to store the integers(positive and negative) i want into a list! > > For e.g. > > Th

Newbie Need Help On Regex!

2016-10-10 Thread infosecflag
Hey guys! I am new to learning regex in python and I'm wondering how do I use regex in python to store the integers(positive and negative) i want into a list! For e.g. This is the data in a list. [u'\x1b[0m[\x1b[1m\x1b[0m\xbb\x1b[0m\x1b[36m]\x1b[0m (A=-5,B=5)', u'\x1b[0m[\x1b[1m\x1b[0m

<    1   2   3   4   5   6   7   8   9   10   >