Postgresql regexp_matches syntax not working as expected
问题 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: