Date
Oct. 18th, 2024
 
2024年 9月 16日

Post: Java 与 RegEx 浅析 001: 概述

Today is the A Memorial Day

Java 与 RegEx 浅析 001: 概述

Published 12:09 Sep 19, 2013.

Created by @ezra. Categorized in #Programming, and tagged as #Java.

Source format: Markdown

Table of Content

Java 是目前极为流行的一门语言,而正则表达式也是开发和维护中必不可少的一个工具,如何将这两者融合成为一个非常重要的问题。

从 2002 年初 Java 发布 1.4 版本后就有了内建的采用 NFA 的正则表达式包 java.util.regex,不仅提供了强大的功能,更可喜的是它的 API 十分简单。 在 java.util.regex 中的方法有:

appendReplacement
appendTail
compile
end
find
flag
group
groupCount
hasAnchoringBounds
hasTransparentBounds
hitEnd
lookingAt
matcher
matcher(Matcher)
matcher(Pattern)
pattern(Matcher)
pattern(Pattern)
quote
QuoteReplacement
region
regionEnd
regionStart
replaceAll
replaceAllRegion
replaceFirst
reguireEnd
reset
split
start
text
toMatcheResult
toString(Matcher)
toString(Pattern)
useAnchoringBounds
usePattern
useTransparentBounds
Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
开发、设计与写作皆为所长。
热爱苹果、钟情色彩。
随时恭候 垂询