javascript - Regular Expression for checking at least one alphabet or number -


i want regular expression checks if string contains allowed characters. allowed characters alphanumeric , special characters (),#\/\-. used expression, , working fine.

/^([a-za-z0-9 .(),#\/\-]*)+$/ 

now don't want string start space or disallowed characters, can have space in middle. also, string may not consist of special characters; should have @ least 1 alphanumeric character.

can me understand how adapt regex using check these additional constraints?

 ^(?=[a-za-z0-9])([a-za-z0-9 .(),#\/-]*)+$ 

this should it.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -