课程:正则表达式
原文: https://docs.oracle.com/javase/tutorial/essential/regex/index.html
本课程介绍如何使用[
java.util.regex](https://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html)
API 与正则表达式进行模式匹配。虽然此程序包接受的语法类似于 Perl 编程语言,但 Perl 的知识不是先决条件。本课程从基础知识开始,逐步构建以涵盖更高级的技术。
Provides a general overview of regular expressions. It also introduces the core classes that comprise this API.
Defines a simple application for testing pattern matching with regular expressions.
Introduces basic pattern matching, metacharacters, and quoting.
Describes simple character classes, negation, ranges, unions, intersections, and subtraction.
Describes the basic predefined character classes for whitespace, word, and digit characters.
Explains greedy, reluctant, and possessive quantifiers for matching a specified expression x number of times.
Explains how to treat multiple characters as a single unit.
Describes line, word, and input boundaries.
Examines other useful methods of the Pattern
class, and explores advanced features such as compiling with flags and using embedded flag expressions.
Describes the commonly-used methods of the Matcher
class.
Methods of the PatternSyntaxException Class
Describes how to examine a PatternSyntaxException
.
To read more about regular expressions, consult this section for additional resources.