I'm trying to create a RegEx that matches the 3 patterns listed above. I can somewhat create a working RegEx for any of those 3 but my problem is creating one that works with all 4 of those. The allowed values are below, where D is any digit and the '.' is never present as a trailing character (i.e. DDD. wouldn't be valid). Also the V and E refer to those specific characters.
- ddd
- ddd.d
- ddd.dd
- Vdd
- Vdd.d
- Vdd.dd
- Eddd
- Eddd.d
Everything else should be invalid, such as:
- d
- dd
- V
- Vd
- Vdd. (trailing '.')
- E
- Ed
- Edd
I'm not great with RegEx, but I could describe part of this pattern for the entries that start with V as the following:
V[0-9]{2,2}(\.[0-9]{1,2})?
I could write very similar statements for the all digit portion of entires and E prefix portion of entries. The problem is how to combine all 3 into a RegEx that doesn't make my head spin to read. What's a good RegEx to match all 3 patterns?
EDIT: I forgot to include the format Vdd.dd