Validating a tridion TCM ID using Regex on javascript, looks quiet simple but unfortunately I failed to do this.
I have attempted all the possible ways to validate a tcm id.
Below is the last tried regex:-
(tcm:(\d)+-(\d)+(-16|-4|-64))\W
Here, TCM ID
can be component
or SG
or Page
.
Valid tcm id's are
- tcm:123-5678-4
- tcm:123-5678-64
- tcm:123-5678-16
- tcm:123-5678
Please suggest the best regex to validate a tcm id.