[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "#" in VERBOSE mode starts a comment and skips to the end of the line. Escape it: "\#". -- nosy: +serhiy.storchaka resolution: not a bug -> stage: resolved -> status: closed -> open ___ Python tracker

[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Ned Batchelder
Ned Batchelder added the comment: I realized my mistake... never mind! -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ _

[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Ned Batchelder
New submission from Ned Batchelder : In this code, the same regex is compiled with and without re.VERBOSE. Without, it compiles fine. With, it fails with an "unterminated subpattern" error. list_num_rx1 = r"""(?P\()?(\d+|#|[a-z])(?(paren)\)|\.)""" list_num_rx2 = r"""(?x)(?P\()?(\