I need to write a regular expression to verify if a file input follows a rule:
A111B2_3_C.exe
in which:
- A: compulsory, it must be a'A'
- 111: compulsory, it is a natural number
- B: compulsory, it must be a'B'
- 2: compulsory, it is in range from 1->6
- _: compulsory, it must be '_'
- 3: compulsory, it must be a nature number
- _: optional if C followed, it must be '_'
- C: optional, C is a natural number
- .exe: is the end extension of the file
It should be accepted this one: A111B2_3_.exe as well. but A111B2_3_0.exe is not accepted. the number after 3_ must be greater than 0.
Thanks in advance.
C
if it's supposed to be a number?