[issue33658] Introduce a method to concatenate regex patterns

2018-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not trivial task because inline flags with global scope can be occurred in any part of the pattern (although using them not at the start of the pattern is deprecated). But starting with 3.7 you can use inline flags with local scope. This will allow

[issue33658] Introduce a method to concatenate regex patterns

2018-05-27 Thread Thrlwiti
Change by Thrlwiti : -- nosy: +THRlWiTi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue33658] Introduce a method to concatenate regex patterns

2018-05-27 Thread Ales Kvapil
New submission from Ales Kvapil : After removing inline flags (deprecated in https://bugs.python.org/issue22493) piping patterns will not work: pats = [r'(?m)^line.continues$', r'(?s)begin.*?end'] re.compile('|'.join(pats)) Maybe there should be introduced some method to merge patterns (simila