Click here to watch in Youtube :
https://www.youtube.com/watch?v=Puu68Cs1Pv0&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
How to define single backslash in Java Regex | Java Regular Expressions | Regex in java |
import java.util.regex.Pattern; public class RegexDemo { public static void main(String[] args) { /* * If you want to define \d, then you must be using \\d in * your regex. */ System.out.println(Pattern.matches("\\d*", "245")); // true } }Output
true
Click the below link to download the code:https://sites.google.com/site/ramj2eev1/home/javabasics/RegexDemo_backslash.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/RegexDemo_backslash
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/950c9f162cb72194a90be45ab9293fca2b84f41c/BasicJava/RegexDemo_backslash/?at=master
See also:
No comments:
Post a Comment