I am trying to match all occurrences of a String Article , followed by a number (one or more digits), not followed by opening parentheses. In Sublime Text, I use the following regular expression:
Article\s[0-9]++(?!\()
to search for the next line:
Article 29 Article 30(1)
which does not comply with Article 30(1) (as I expect), but Article 29 and Article 1 .
When trying to do the same in Python (3) using
import re article_list = re.findall(r'Article\s[0-9]++(?!\()', "Article 30(1)")
I get the following error as I use a (nested) possessive quantifier that is not supported by the Python regular expression. Is there a way to map what I want (not) to fit in Python?
source share