 |
Subscribe to this site |
|
Check Phonenumber

Published 3 months ago
by
RIS
String mobile= "079841";
def String regex = "^[0]"
def String regexTwo = "^[0]{2}"
def String regexThree = "\\+|00"
if (mobile.matches("(075|076|077|078|079).*"))
{
String mobileNew= mobile.replaceFirst(regex, "41");}
else if (mobile.matches("(00|\\+).*")){
String mobileNew= mobile.replaceFirst(regexThree, "");
return mobileNew;}
else if (mobile.matches("^(?!0)\\d.[0-9]+\$")){
return "test";}
else{
return mobileNew = "no correct Phonenumber";
}