Regex to certain special characters -


currently have following regex use validate name of company/industry , working fine

  /(?=[a-za-z0-9-]{5,25}$)^[a-za-z0-9]+(-[a-za-z0-9]+)*$/ 

the above regex doesnt supports special characters & - . _ valid in case

i came wasnt working expected.

 /(?=[a-za-z0-9-\&\_\.]{5,25}$)^[a-za-z0-9\&\_\.]+(-[a-za-z0-9\&\_\.]+)*$/ 

can point out above regex goes wrong. short explaination of above regex wud appreciated thanks

i don't think have escape & \&, same way _ also

/(?=[a-za-z0-9-&_\.]{5,25}$)^[a-za-z0-9&_\.]+(-[a-za-z0-9&_\.]+)*$/ 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -