Message263567
| Author |
arbyter |
| Recipients |
arbyter |
| Date |
2016年04月16日.16:48:11 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1460825291.89.0.971564767313.issue26784@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Working with this example string "E-112233-555-11 | Bläh - Bläh" with the following code leeds under python 2.7.10 (OSX) to an exception whereas the same code works under python 3.5.1 (OSX).
s = "E-112233-555-11 | Bläh - Bläh"
expr = re.compile(r"(?P<p>[A-Z]{1}-[0-9]{0,}(-[0-9]{0,}(-[0-9]{0,})?)?)?(( [|] )?(?P<a>[\s\w]*)?)? - (?P<j>[\s\w]*)?",re.UNICODE)
res = re.match(expr,s)
a = (res.group('p'), res.group('a'), res.group('j'))
print(a)
When I change the first umlaut in "Bläh" from ä to ü it works as expected on python 2 and 3. A change from ä to ö however leeds to a crash again.
Ideas? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年04月16日 16:48:11 | arbyter | set | recipients:
+ arbyter |
| 2016年04月16日 16:48:11 | arbyter | set | messageid: <1460825291.89.0.971564767313.issue26784@psf.upfronthosting.co.za> |
| 2016年04月16日 16:48:11 | arbyter | link | issue26784 messages |
| 2016年04月16日 16:48:11 | arbyter | create |
|