This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Regex Expression Error
Type: crash Stage:
Components: Regular Expressions Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, sleepyfish
Priority: normal Keywords:

Created on 2009-01-21 05:52 by sleepyfish, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg80317 - (view) Author: sleepyfish (sleepyfish) Date: 2009-01-21 05:52
import re
re.match(r'[/- ]','/') crash, but re.match(r'[ /-]','/'), or
re.match(r'[/ -]','/'), or re.match(r'[ -/]','/') ...

only when the match pattern is r'[/-]', the program crash

I run it in version 2.6.1 and version 3.0, both having the same problem
msg80320 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-01-21 09:02
> the program crash
Well, it's not a crash, but a graceful exception:
    sre_constants.error: bad character range

Your regular expression is invalid: the '-' has a special meaning inside
square brackets.
Please consult the documentation: http://docs.python.org/library/re.html
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49270
2009-01-21 09:03:02amaury.forgeotdarcsetstatus: open -> closed
resolution: not a bug
messages: + msg80320
nosy: + amaury.forgeotdarc
2009-01-21 05:52:34sleepyfishcreate