I use the Postgres regexp_matches function to extract numbers.
The regular expression I use is
4([\s\-\/\.]*?0){3}([\s\-\/\.]*?[12]){1}([\s\-\/\.]*?\d){4}
If I use a tool like https://regexr.com/ to verify if it's working and I apply the following test set
4-0001-1234
5-2342-2344
499999999
4-0001-1234 4.0001.12344 4-0-0-0-1-1234
I get the expected extraction result:
4-0001-1234
4-0001-1234
4.0001.1234
4-0-0-0-1-1234
However, if I use the same expression in Postgresql, it does work well:
SELECT unnest(regexp_matches('4-0001-1234', '4([\s\-\/\.]*?0){3}([\s\-\/\.]*?[12]){1}([\s\-\/\.]*?\d){4}', 'g'));
Result:
0
1
4
What I suspect is, that it has to do with the greediness and/or that the quantifiers like {3} are not applied in the right way. Or it uses the Posix standard for regular expressions, which always seem to differ a little bit from the Java Syntax.
Any suggestions why it is not working and how to fix it?

{1}is pointless.