Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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
 
PREVIOUS NEXT
Tagged: #number #regex #java
ADD COMMENT
Topic
Name
5+2 =