Groovy web console

subscribe to the feed Subscribe
to this
site

Phone Number Validation

Published 5 months ago by Mak with tags validation phonenumber
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def phoneNumber="1234567890"
def phoneNumberRegex=/\+\d{1,12}/
if(phoneNumber.matches(phoneNumberRegex))
println("Phone Number verified")
else 
println("Phone Number not verified")