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
Post a Comment