I am trying to write a regular expression for validating characters
13 characters and the first 5 starts must be ABCDE
for example
- ABCDE12312345 – valid
- ABCDE14512345 – valid
- 1234145123454 – NOT valid because not start with ABCDE // first five charaters must be ABCED and in total 13 characters
I am tried google but no luck
>Solution :
how about that:
r"^ABCDE.{8}$"
^start of string- followed by
ABCDE .{8}.` matches anything exact 8 times to get you to a length of 13$end of string
see here