I am trying to detect if a sequence of text begins with a numbering, eg I)
, IV.
, a)
, C/
, C.
C -
, C-
etc with a regex.
I tried the following regex :
m = re.search(r'^(IX?{\s|-|-\s|,|,\s|\)|\)\s|.|.\s}|IV?{\s|-\s|-|\)|\)\s|.\s|.}|VI{0,3}?{\s|-|-\s|\)|\)\s|.|.\s})', "II - Informations supplementaires")
m.group(0)
>> 'I'
m.group(1)
>> 'I'
It only gives me 'I' as a result, I don't have "II", "II -", which are expected .... What is my error in the pattern ^^ ?