Expression rgulire tlphone 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");
}
Dangerous Dormouse