当前位置:网站首页>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语言中的函数(详解)
- How to implement cross domain requests
- The solution of win11 taskbar right click without Task Manager - add win11 taskbar right click function
- 198. House raiding
- Operator < <> > fool test case
- R statistical mapping - random forest classification analysis and species abundance difference test combination diagram
- 2022.7.2-----leetcode.871
- 剑指 Offer II 038. 每日温度
- Appium基础 — APPium安装(二)
- QT qtablewidget table column top requirements ideas and codes
猜你喜欢
Learning multi-level structural information for small organ segmentation
ABAP:OOALV实现增删改查功能
After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
C语言中的函数(详解)
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
注释与注解
C语言练习题(递归)
Error CVC complex type 2.4. a: Invalid content beginning with element 'base extension' was found. Should start with one of '{layoutlib}'.
Detailed explanation of common APIs for component and container containers: frame, panel, scrollpane
Win10 clear quick access - leave no trace
随机推荐
My NVIDIA developer journey - optimizing graphics card performance
QT qtablewidget table column top requirements ideas and codes
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
[openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
Average two numbers
How to realize multi account login of video platform members
Sort list tool class, which can sort strings
ABAP:OOALV实现增删改查功能
Impact relay jc-7/11/dc110v
How to implement cross domain requests
JSON Web Token----JWT和傳統session登錄認證對比
27-31. Dependency transitivity, principle
Vant --- detailed explanation and use of list component in vant
2022.7.3-----leetcode. five hundred and fifty-six
Manually page the list (parameter list, current page, page size)
微信小程序使用rich-text中图片宽度超出问题
MySQL learning notes 3 - JDBC
FRP intranet penetration, reverse proxy
《ClickHouse原理解析与应用实践》读书笔记(4)
Bicolor case