By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SELECT 3
| sample | comment | regexp_matches |
|---|---|---|
| bax 45456xx888z 89776uuu | no digits with an `a` up front | {45456} |
| bax 45456xx888z 89776uuu | no digits with an `a` up front | {888} |
| bax 45456xx888z 89776uuu | no digits with an `a` up front | {89776} |
| abax 45456xx888z 89776uuu | `a` before everything | {45456} |
| abax 45456xx888z 89776uuu | `a` before everything | {888} |
| abax 45456xx888z 89776uuu | `a` before everything | {89776} |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | {89776} |
SELECT 7
| sample | comment | regexp_matches |
|---|---|---|
| bax 45456xx888z 89776uuu | no digits with an `a` up front | {45456} |
| bax 45456xx888z 89776uuu | no digits with an `a` up front | {888} |
| bax 45456xx888z 89776uuu | no digits with an `a` up front | {89776} |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | {45456} |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | {888} |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | {89776} |
SELECT 6
| sample | comment | m |
|---|---|---|
| bax 45456xx888z 89776uuu | no digits with an `a` up front | 45456 |
| bax 45456xx888z 89776uuu | no digits with an `a` up front | 888 |
| bax 45456xx888z 89776uuu | no digits with an `a` up front | 89776 |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | 45456 |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | 888 |
| bax a45456xxa888z 89776uuu | the first 2 digit sequences have a leading `a`, none up front | 89776 |
SELECT 6