Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

number regex java

String regex = "[0-9]+"; // or String regex = "d+";
String str = "123";
System.out.println(str.matches(regex)); // true
str = "12a";
System.out.println(str.matches(regex)); // false
Comment

java regex 10 digit number

String regex = "^d{10}$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher("9876543210");
matcher.matches(); // returns true if pattern matches, else returns false
Comment

PREVIOUS NEXT
Code Example
Java :: keytool error: java.io.FileNotFoundException: my-release-key.keystore (Access is denied) java.io.FileNotFoundException: my-release-key.keystore (Access is denied) 
Java :: decode base64 to file java 
Java :: how to resize image in java swing 
Java :: java 8 datediff in days 
Java :: multiple type array java 
Java :: split string regex java 
Java :: isdigit java 
Java :: check if string is uuid 
Java :: root to leaf sum leetcode 
Java :: java length of matrix 
Java :: cannot find symbol variable log 
Java :: create new empty list java 
Java :: How to determine whether a graph contains a cycle, in Java? 
Java :: how to convert char to uppercase java 
Java :: how to initialize array in java 
Java :: imageview height based on screen size 
Java :: rotate a linked list 
Java :: number of digits java 
Java :: java string replace character at position 
Java :: java array initialization 
Java :: react The href attribute is required for an anchor to be keyboard 
Java :: java constructor chaining 
Java :: java stream get all max values 
Java :: addall java 
Java :: loop through treeset java 
Java :: diamond star pattern in java 
Java :: all installed java 
Java :: max and min array number in java 
Java :: java interfce 
Java :: load contents of file into string java 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =