expression régulière téléphone java
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");
}
Also in Java:
- Title
- how to get witdth of window android
- Category
- Java
- Title
- run static method java
- Category
- Java
- Title
- Java array hashcode
- Category
- Java
- Title
- adding an element to the end of a linked list java
- Category
- Java
- Title
- spigot custom join message
- Category
- Java
- Title
- java classes and methods simple logic with comments
- Category
- Java
- Title
- find length of array java
- Category
- Java
- Title
- java string format with placeholder
- Category
- Java
- Title
- java regex replace all characters before
- Category
- Java
- Title
- java string to integer
- Category
- Java
- Title
- java logical operator
- Category
- Java
- Title
- primitive and non primitive data types in java
- Category
- Java
- Title
- resurce leak java
- Category
- Java
- Title
- filter and map multiple fields from java stream
- Category
- Java
- Title
- pretty print json in console
- Category
- Java
- Title
- faire un timer en java
- Category
- Java
- Title
- how to check the lines in a file java scanner
- Category
- Java
- Title
- comparable on a generic class java
- Category
- Java
- Title
- java create file with content
- Category
- Java
- Title
- how to declare a linked list in java
- Category
- Java
- Title
- spigot action bar
- Category
- Java
- Title
- java create arraly list
- Category
- Java
- Title
- bootstrap button bigger
- Category
- Java
- Title
- hibernate Unknown integral data type for ids : java.lang.String
- Category
- Java
- Title
- how to initialize main in java
- Category
- Java
- Title
- java if a or b
- Category
- Java
- Title
- java shortest if else statement
- Category
- Java
- Title
- in dom parser how to find processing instruction in java
- Category
- Java
- Title
- async in fragment
- Category
- Java
- Title
- java
- Category
- Java
- Title
- java syntax
- Category
- Java
- Title
- enum with numbers java
- Category
- Java
- Title
- how to get length of integer in java
- Category
- Java
- Title
- sdkmanager JAVA_HOME invalid directory
- Category
- Java
- Title
- Error executing Maven. java.io.FileNotFoundException: The specified user settings file does not exist: /etc/java-8-openjdk
- Category
- Java
- Title
- java hashmap size
- Category
- Java
- Title
- how to use for loop for array in java
- Category
- Java
- Title
- write file java
- Category
- Java
- Title
- enumerated data types in java
- Category
- Java
- Title
- check if user has internet connection in kotlin
- Category
- Java
- Title
- java count substring occurrences in string
- Category
- Java
- Title
- java stack push
- Category
- Java
- Title
- java script using navigator.useragent to detect the browse
- Category
- Java
- Title
- bootstrap alert
- Category
- Java
- Title
- hashmap get value java
- Category
- Java
- Title
- arraylist java methds
- Category
- Java
- Title
- java switch
- Category
- Java
- Title
- butterfly pattern program in java
- Category
- Java
- Title
- spark write partitionby
- Category
- Java
- Title
- long to int java 8
- Category
- Java
- Title
- using java 8 stream to process data in java
- Category
- Java
- Title
- why python is slower than java
- Category
- Java
- Title
- find min in array java
- Category
- Java
- Title
- Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification
- Category
- Java
- Title
- java method
- Category
- Java
- Title
- java tester si un caractere est une lettre
- Category
- Java
- Title
- saving String character in arraylist
- Category
- Java
- Title
- java get last element of list
- Category
- Java
- Title
- processing sound android
- Category
- Java
- Title
- how to make a list java
- Category
- Java
- Title
- java integer compareto
- Category
- Java
- Title
- how to create a draw Rectangle in java
- Category
- Java
- Title
- linux change java
- Category
- Java
- Title
- if and in java
- Category
- Java
- Title
- declare array java inline
- Category
- Java
- Title
- java go troght loop object
- Category
- Java
- Title
- simple javascript to detect browser using java utils
- Category
- Java
- Title
- how to use an abstract class in java
- Category
- Java
- Title
- how to create an action listener in java
- Category
- Java
- Title
- spigot run task later
- Category
- Java
- Title
- byte java
- Category
- Java
- Title
- [ERROR] Error executing Maven. java.io.FileNotFoundException: The specified user settings file does not exist: /usr/lib/jvm/java-1.8.0-openjdk-amd64
- Category
- Java
- Title
- java stack
- Category
- Java
- Title
- validation list empty java
- Category
- Java
- Title
- get world by name bukkit
- Category
- Java
- Title
- Enums injava
- Category
- Java
- Title
- spigot cancel repeating task
- Category
- Java
- Title
- how to make array of objects in java and use it
- Category
- Java
- Title
- java get command line input
- Category
- Java
- Title
- java previous permutation
- Category
- Java
- Title
- loop through java object
- Category
- Java
- Title
- how to open a webpage with java
- Category
- Java
- Title
- two pointer approach java
- Category
- Java
- Title
- how to change the color of a menubar in java
- Category
- Java
- Title
- jbutton close jframe java
- Category
- Java
- Title
- how to create a button in java
- Category
- Java
- Title
- java while loop example
- Category
- Java
- Title
- string to arraylist convert java
- Category
- Java
- Title
- create object of static class in java
- Category
- Java
- Title
- number to string java
- Category
- Java
- Title
- shorthand if java without else
- Category
- Java
- Title
- math minimum java
- Category
- Java
- Title
- array null pointer java
- Category
- Java
- Title
- how to make a loop in java
- Category
- Java
- Title
- how to check if a list is empty java
- Category
- Java
- Title
- java for each loop
- Category
- Java
- Title
- how to find the total of the products added to the shopping cart in java program
- Category
- Java
- Title
- how to instanciate map.entry java
- Category
- Java
- Title
- joptionpane fonctionnement java
- Category
- Java
- Title
- java animated gif example
- Category
- Java