Hello, I would like assistance in generating a regular expression for a Study ID which can take the following formats:
K-XXXX-IPD
K-XXXX-MOPD
K-XXXX-AE
Where X is a number i.e. K-1234-IPD, K-1234-MOPD, K-5432-AE
Thanks a lot!
Hello, I would like assistance in generating a regular expression for a Study ID which can take the following formats:
K-XXXX-IPD
K-XXXX-MOPD
K-XXXX-AE
Where X is a number i.e. K-1234-IPD, K-1234-MOPD, K-5432-AE
Thanks a lot!
Hi @kabalaandrew
something like this probably:
^K-[0-9]{4}-(IPD|MOPD|AE)$
just to explain:
^
the beginning of the text https://javascript.info/regexp-anchors
K-
which is your static value
[0-9]{4}
numbers from 0-9 used 4 times
-
static value
(IPD|MOPD|AE)
IPD or MOPD or AE
$
the end of the text https://javascript.info/regexp-anchors