1

学习笔记-Java常用正则表达式

 2 years ago
source link: https://mikeygithub.github.io/2022/01/27/yuque/qy4tlv/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
学习笔记-Java常用正则表达式 - 麦奇

学习笔记-Jav_

Mikey 2022年1月27日 下午

173 字

1 分钟

  • Pattern 类:pattern 对象是一个正则表达式的编译表示。Pattern 类没有公共构造方法。要创建一个 Pattern 对象,你必须首先调用其公共静态编译方法,它返回一个 Pattern 对象。该方法接受一个正则表达式作为它的第一个参数。
  • Matcher 类:Matcher 对象是对输入字符串进行解释和匹配操作的引擎。与 Pattern 类一样,Matcher 也没有公共构造方法。你需要调用 Pattern 对象的 matcher 方法来获得一个 Matcher 对象。
  • PatternSyntaxException:PatternSyntaxException 是一个非强制异常类,它表示一个正则表达式模式中的语法错误。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK