[issue36158] Regex search behaves differently in list comprehension

2019-04-02 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: pending -> closed ___ Python tracker ___ ___

[issue36158] Regex search behaves differently in list comprehension

2019-03-05 Thread Josh Rosenberg
Change by Josh Rosenberg : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36158] Regex search behaves differently in list comprehension

2019-03-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: Sounds like at least one such entity's trigger attribute doesn't match the regex. In the spelled out loop, you'd still get the exception on a failed match, but you'd store the results for however many entities matched before then (so catching the exception

[issue36158] Regex search behaves differently in list comprehension

2019-03-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36158] Regex search behaves differently in list comprehension

2019-03-02 Thread Ma Lin
Ma Lin added the comment: Just remind, the pattern r'"{1}', is same as r'"', means " repeats 1 time. -- nosy: +Ma Lin ___ Python tracker ___

[issue36158] Regex search behaves differently in list comprehension

2019-03-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: > i want to apply a regex on a list of strings. The example you give doesn't include a list of strings, it has some unknown "entity" object with an unknown "trigger" attribute. Please refactor the code to remove the use of a class we don't have access to.

[issue36158] Regex search behaves differently in list comprehension

2019-03-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Can you please add a short script with data for entities to try reproducing this? >>> from re import compile >>> name_regex = compile(r'\[\"([a-zA-Z\s]*)\"{1}') >>> [name_regex.match(a).group(1) for a in ['["a"a]']] ['a'] >>> list(map(lambda a:

[issue36158] Regex search behaves differently in list comprehension

2019-03-01 Thread Matthew Drago
New submission from Matthew Drago : Say for example i want to apply a regex on a list of strings. Using list comprehension as such results in the group method not being found. ``` name_regex = compile(r'\[\"([a-zA-Z\s]*)\"{1}') named_entities = [name_regex.match(entity.trigger).group(1) for