Click here to Skip to main content
15,896,496 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to validate the Alphanumeric with some special Characters(/and -). I wrote the Following expression. But it come Syntax error .
This is My Expression :
/^[a-zA-Z0-9/-]+$/
Posted
Updated 6-Jul-13 13:33pm
v2

This may help you: txt2re - Regular Expression Generator[^] and Regular Expression Test Tool[^]

Try this for your regular expression:
/^[a-zA-Z0-9-\/]+$/


I put the escape character \ in front of the /
 
Share this answer
 
v5
For matching text like:
asd-sda9009
AsDs-243-325
JavaScript
/^[a-z0-9\-]+$/i
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900