I have the following kind of string "sometext1 §§ 12 Abs. 5, 13a, 14 Satz 1 Nr. 3, 9, 8 sometext2"
. I want to find a §§
substring and all consecutive occurrences of Abs.
, und
, Satz
and Nr.
as well as digits with a single character like 13a
.
Examples:
"Die Anzahl der §§ 12 Abs. 5, 13a, 14 Satz 1 und 8 kann variieren. Für die §§ 15a, 18 Abs. 5, 21 und 23 Satz 3 trifft dies nicht zu.
Here I want to get 12 Abs. 5, 13a, 14 Satz 1 und 8
and 15a, 18 Abs. 5, 21 und 23 Satz 3
.
I used the following regex 'r'§§ (.*)? ^(?!Satz|Abs.|Nr.|\d+[a-z]| |,)'
.