Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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");
}
Comment

PREVIOUS NEXT
Code Example
Java :: pythagoras method in java 
Java :: retrofit post body 
Java :: java base64 decrypt script 
Java :: jpql spring boot 
Java :: close GUI in jvava 
Java :: Pattern Programs in Java. 
Java :: Java Find the greatest common divisor of two positive integers. The integers can be large, so you need to find a clever solution. 
Java :: java resultset to table 
Java :: multiple representations of the same entity are being merged 
Java :: UPLOAD TEXTFILE USING CYPERTEXT USING JAVA 
Java :: object null java 
Java :: localbroadcastmanager android example 
Java :: java stream 
Java :: java continue statement 
Java :: java random number generator 
Java :: how to get filename without extension in java 
Java :: how to print each element of an arraylist on a new line in java 
Java :: java string replaceall for space 
Java :: tostring java 
Java :: array index out of bound exception in java 
Java :: login.html 
Java :: Java Change ArrayList Elements 
Java :: java return pair 
Java :: generic variable java 
Java :: join arrays in java 
Java :: radix sort 
Java :: properties object using a file 
Java :: Load array of strings from console 
Java :: output of this 
Java :: assign a random number in a set without replacement javva 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =