I need a regex which should validate a value which
- can be a 3 digit number OR
- can be a 4 digit number but the first digit should be 0 OR
- can be a alpha numeric value with length 5
I did this regex which seems to working but I believe there is a better way of writing this. This is my regex. Please suggest a better way
(^[0-9]{3}$)|(^0[0-9]{3}$)|(^[0-9a-zA-Z]{5}$)