Issue36349
Created on 2019-03-18 15:03 by Farbod Safe2, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg338234 - (view) | Author: Farbod Safe (Farbod Safe2) | Date: 2019-03-18 15:03 | |
Below two print statements should give the same results but they don't: import re s = '[a]' print(*re.findall(r'\[.*]',s)) [a] print(*re.findall(r'\[(.*)]',s)) a |
|||
| msg338236 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2019-03-18 15:07 | |
3.6 is in security mode and not in bugfix mode. Please, use 3.7. |
|||
| msg338237 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2019-03-18 15:07 | |
Python 3.7.2 (default, Jan 16 2019, 19:49:22) [GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> s = '[a]' >>> print(*re.findall(r'\[.*]', s)) [a] >>> print(*re.findall(r'\[.*]', s)) [a] >>> |
|||
| msg338239 - (view) | Author: SilentGhost (SilentGhost) * ![]() |
Date: 2019-03-18 15:19 | |
Fabrod, this has nothing to do with the square brackets. It is your assumption that the return value should be the same that is wrong. Cf.: >>> re.findall(r'a.+', 'abc') ['abc'] >>> re.findall(r'a(.+)', 'abc') ['bc'] This is the correct documented behaviour. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:12 | admin | set | github: 80530 |
| 2019-03-18 15:19:52 | SilentGhost | set | resolution: out of date -> not a bug messages:
+ msg338239 |
| 2019-03-18 15:07:34 | matrixise | set | messages: + msg338237 |
| 2019-03-18 15:07:15 | matrixise | set | status: open -> closed nosy:
+ matrixise resolution: out of date |
| 2019-03-18 15:03:59 | Farbod Safe2 | create | |

