Groovy web console

subscribe to the feed Subscribe
to this
site
Validate a string of 2 digits and numbers only (via #groovywebconsole)
tweet this snippet Tweet
this
script

Validate a string of 2 digits and numbers only

Published 6 months ago by Imran Shaik
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
String Str="12"
String Str1="[0-9]{2}"
if(Str.matches(Str1))
{
print true
}
else
print false