当前位置:网站首页>regular expression
regular expression
2022-07-04 06:29:00 【Envy the cloud rather than the king】
stay java In a /: Represents the translation character , So we need two // It means a /.
Code :
public class Matching basis {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "abc";
System.out.println(str.matches("abc"));
}
}
Code :
public class Matching basis {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "a&c";
System.out.println(str.matches("a\\&c"));
}
}
Code :
public class Matching basis {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "a and c";
System.out.println(str.matches("a\\u548cc"));
}
}
Code :
public class Matching basis {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "a and c";// and : Right and wrong ASCALL character
System.out.println(str.matches("a.c"));
String str1 = "a.c";//.: It's a special character
System.out.println(str1.matches("a.c"));// there . Represents matching any character
System.out.println(str1.matches("a\\.c"));// Here is the match . This special character : Special character matching requires translation
}
}
\d*: Indicates that any number can be matched
Be careful :System.out.println(str1.matches("*")); This is incorrect
System.out.println(str1.matches("+")); This is incorrect
however
System.out.println(str1.matches(".")); It's the right way to use it : The table matches any character
\d+: Indicates that at least one number is matched
\d?: Represents a match 0 Or 1 A digital
matching a-f perhaps 0-9 In between 6 Characters
Can match a To f perhaps 0 To 9 perhaps _ Medium 6 Characters
边栏推荐
- C实现贪吃蛇小游戏
- Invalid bound statement (not found): com. example. mapper. TblUserRecordMapper. login
- 2022.7.3-----leetcode.556
- Error CVC complex type 2.4. a: Invalid content beginning with element 'base extension' was found. Should start with one of '{layoutlib}'.
- Learning multi-level structural information for small organ segmentation
- C language - Blue Bridge Cup - Snake filling
- Appium基础 — APPium安装(二)
- 11. Dimitt's law
- Lightroom import picture gray / Black rectangular multi display
- Sword finger offer II 038 Daily temperature
猜你喜欢
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
Matlab remainder
17-18. Dependency scope and life cycle plug-ins
JSON web token -- comparison between JWT and traditional session login authentication
JS how to convert seconds into hours, minutes and seconds display
Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
[March 3, 2019] MAC starts redis
如何避免 JVM 内存泄漏?
ABAP:OOALV实现增删改查功能
随机推荐
24 magicaccessorimpl can access the debugging of all methods
1、 Relevant theories and tools of network security penetration testing
Invalid revision: 3.18.1-g262b901-dirty
uniapp 自定义环境变量
Webrtc quickly set up video call and video conference
R统计绘图-随机森林分类分析及物种丰度差异检验组合图
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
C language - Blue Bridge Cup - Snake filling
[March 3, 2019] MAC starts redis
My NVIDIA developer journey - optimizing graphics card performance
雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
Win10 clear quick access - leave no trace
QT get random color value and set label background color code
Sword finger offer II 038 Daily temperature
QT qtablewidget table column top requirements ideas and codes
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
C语言中的排序,实现从小到大的数字排序法
JSON Web Token----JWT和傳統session登錄認證對比
FRP intranet penetration, reverse proxy
AWT introduction