Answers for "expression régulière téléphone java"

0

expression régulière téléphone java

// verifie le format d'un String de numero de telephone et ajuste le format
// Format possible : xxxxxxxxxx || xxx xxxxxxx || xxxxxx xxxx || xxx xxx xxxx
// xxx-xxxxxxx || xxxxxx-xxxx || xxx-xxx xxxx || xxx xxx-xxxx || xxx-xxx-xxxx
// (xxxxxxxxxx || xxx)xxxxxxx || (xxx xxxxxxx || xxx) xxxxxxx || (xxx-xxxxxxx
// etc.
// Format final : (xxx)xxx-xxxx
if(numero.matches("\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})")){
	newNumero = numero.replaceFirst("\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})", "($1)$2-$3");
}
Posted by: Guest on May-15-2020

Code answers related to "expression régulière téléphone java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language