Barry Jones
asked on
JavaScript Regex validation - simple list of allowed chars
Hi.
Please can someone show me the correct regex for ensuring input has ONLY the following list of chars, in any order:
0123456789-+()
Any number of whitespace is allowed.
My test code attached.
TIA, TheFoot
Please can someone show me the correct regex for ensuring input has ONLY the following list of chars, in any order:
0123456789-+()
Any number of whitespace is allowed.
My test code attached.
TIA, TheFoot
function(v_val){
return /^[0-9-+]$/.test(v_val);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome! Thanks for your quick response..
Open in new window