I would like to match some pattern multiple times, exactly like described here.
^(somelongpattern[0-9])([,; ]+(?1))*$
This will match for example:
somelongpattern0
somelongpattern9 ,; somelongpattern2
However above code works in pcre, it does not work not in java. It gives me an error "unclosed options group" on (?1)
Is there any way how to do this? I have a very long regex pattern and i don't want to repeat it 2 times if possible.