Class MatcherUtil

java.lang.Object
cloud.opencode.base.string.regex.MatcherUtil

public final class MatcherUtil extends Object
Matcher Utility - Provides regex matcher helper methods. 匹配器工具 - 提供正则匹配器辅助方法。

Features | 主要功能:

  • Create Matcher from regex string or Pattern - 从正则字符串或Pattern创建Matcher

Usage Examples | 使用示例:

Matcher m = MatcherUtil.create("\\d+", "abc123");
if (m.find()) { String digits = m.group(); }

Security | 安全性:

  • Thread-safe: Yes (stateless utility) - 线程安全: 是(无状态工具类)
  • Null-safe: No (input must not be null) - 空值安全: 否(输入不能为空)

Performance | 性能特性:

  • Time complexity: O(n) per match where n = input length - 每次匹配 O(n), n为输入长度
  • Space complexity: O(m) where m = number of matches - O(m), m为匹配数
Since:
JDK 25, opencode-base-string V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also: