Hi there,
I just learned regex, i tried to use javascript .test function to validate the following
pattern but failed, i was told they are kind of
java regex, but i do not know what is difference between java regex and javascript regex, please help:
1. [\p{Alpha}\.]{0,6} to validate GENDER ,it means that 0 to 6 number is allowed, right?
2. [\p{Alpha}\._ -]{0,31} to validate STATE ,0 to 31 number will be fine, right?
3. [\p{Alnum}\. -]* to validate ZIP CODE, nubmer and alpha will be fine, right?
4. \+?[\d\.() -]{0,28}[\p{Alpha}\.\+ ]{0,6}?\d{0,4}? to validate PHONE NUMBER.
I used the following JAVASCRIPT code:
when i input #%×%% as value,all the above did not show alert, which suppose only allow number and alphabet, could anyone help to figure out what is wrong with it, thanks a lot for help!!