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 :: change color of text in textview android 
Java :: android java remove action bar 
Java :: Input console using java 
Java :: How to efficiently find the middle node of a singly linked list, in Java? 
Java :: convert char to string java 
Java :: in a junit test how test if empty list is returned 
Java :: get all number from string java 
Java :: spring data rest partial update 
Java :: button color xml 
Java :: discord jda remove @everyone from channel 
Java :: how to create textview programmatically in android 
Java :: add text to jlable 
Java :: add oracle jdbc driver to eclipse java project 
Java :: how to shuffle string java 
Java :: how to set landscape in android studio 
Java :: how to convert an object into string with different fields in java 
Java :: Convert Octal to Binary in java 
Java :: append button java 
Java :: convert hashset to array 
Java :: how to import java.util 
Java :: java delete files 
Java :: find duplicate value in array using java 
Java :: Java How to use SortedMap? 
Java :: print two varaibles using one statement in java 
Java :: even digit sum java 
Java :: create arraylist from array java 
Java :: what is import java.io.*? 
Java :: what is an error in java 
Java :: create a toast message in android 
Java :: java substring 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =