Skip to content
DevToolKit

正则表达式速查表

免费在线正则表达式速查表,内容来源于官方文档、RFC标准文件和技术社区最佳实践,经过实际环境验证后定期更新保持准确性。支持全文关键词搜索和分类标签浏览,覆盖从入门基础命令到高级技巧的完整内容体系。页面加载后全部内容可离线浏览,适合开发者日常快速查阅命令语法和学习参考。覆盖入门基础到高级技巧完整体系。

Search Reference

49 of 49 tokens
.
Any character

Matches any single character except newline (unless s flag is set).

\d
Digit

Matches any digit character (0-9). Equivalent to [0-9].

\D
Non-digit

Matches any character that is not a digit. Equivalent to [^0-9].

\w
Word character

Matches any alphanumeric character plus underscore. Equivalent to [a-zA-Z0-9_].

\W
Non-word character

Matches any character that is not a word character. Equivalent to [^a-zA-Z0-9_].

\s
Whitespace

Matches any whitespace character: space, tab, newline, carriage return, form feed.

\S
Non-whitespace

Matches any character that is not whitespace.

[abc]
Character set

Matches any one of the characters inside the brackets.

[^abc]
Negated set

Matches any character NOT inside the brackets.

[a-z]
Character range

Matches any character in the specified range (inclusive).

[a-zA-Z]
Combined range

Matches any uppercase or lowercase letter using combined ranges.

[0-9a-fA-F]
Hex digit range

Matches hexadecimal characters by combining digit and letter ranges.

^
Start of string

Matches the start of a string (or line in multiline mode).

$
End of string

Matches the end of a string (or line in multiline mode).

\b
Word boundary

Matches the position between a word character and a non-word character.

\B
Non-word boundary

Matches any position that is NOT a word boundary.

*
Zero or more

Matches the preceding element zero or more times (greedy).

+
One or more

Matches the preceding element one or more times (greedy).

?
Zero or one

Matches the preceding element zero or one time (optional).

{n}
Exactly n

Matches the preceding element exactly n times.

{n,}
n or more

Matches the preceding element at least n times (greedy).

{n,m}
Between n and m

Matches the preceding element between n and m times (inclusive, greedy).

*?
Lazy zero or more

Matches zero or more times, but as few as possible (lazy/non-greedy).

+?
Lazy one or more

Matches one or more times, but as few as possible (lazy/non-greedy).

??
Lazy zero or one

Matches zero or one time, preferring zero (lazy/non-greedy).

(abc)
Capturing group

Groups multiple tokens together and captures the matched text for back-referencing.

(?:abc)
Non-capturing group

Groups tokens together without capturing. Useful for applying quantifiers to groups.

(?<name>abc)
Named group

Captures the matched text and assigns it a name for easier reference.

\1
Backreference

Matches the same text as previously captured by the nth capturing group.

(a|b)
Group alternation

Captures one alternative from inside a group. Combines grouping with alternation.

|
Alternation (OR)

Matches the expression before or after the pipe. Acts as a boolean OR.

\\
Escaped backslash

Matches a literal backslash character.

\n
Newline

Matches a line feed character (LF, U+000A).

\t
Tab

Matches a horizontal tab character (U+0009).

\r
Carriage return

Matches a carriage return character (CR, U+000D).

\.
Escaped dot

Matches a literal period/dot character.

\^
Escaped caret

Matches a literal caret character.

\$
Escaped dollar

Matches a literal dollar sign character.

\(
Escaped parenthesis

Matches a literal opening parenthesis.

g
Global

Find all matches rather than stopping after the first match.

i
Case-insensitive

Makes the entire pattern case-insensitive.

m
Multiline

Makes ^ and $ match the start/end of each line rather than the whole string.

s
Dotall (single-line)

Makes the dot (.) match newline characters as well.

u
Unicode

Enables full Unicode matching. Required for proper emoji and surrogate pair handling.

y
Sticky

Matches only at the index indicated by the lastIndex property. Does not search forward.

(?=abc)
Positive lookahead

Asserts that what follows the current position matches the pattern, without consuming characters.

(?!abc)
Negative lookahead

Asserts that what follows the current position does NOT match the pattern.

(?<=abc)
Positive lookbehind

Asserts that what precedes the current position matches the pattern, without consuming characters.

(?<!abc)
Negative lookbehind

Asserts that what precedes the current position does NOT match the pattern.

Live Sandbox

//g
Flags
No matches found

Common Patterns

Was this tool helpful?

使用方法

使用正则表达式速查表只需简单几步即可获得专业级的处理结果:

  1. 输入数据: 在输入区域粘贴文本、上传文件或直接输入数据。正则表达式速查表会自动识别输入格式并进行预处理,无需手动选择格式类型。
  2. 配置参数: 根据需要调整处理参数和输出选项。每个选项都有合理的默认值,大多数情况下无需手动修改即可获得满意结果。高级用户可以精细调节每个参数。
  3. 处理执行: 点击处理按钮或等待自动处理。正则表达式速查表在浏览器中本地执行所有计算和数据处理,处理速度快且完全保护数据隐私安全。
  4. 查看结果: 结果会立即显示在输出面板中。您可以预览处理效果、验证结果是否符合预期,并根据需要重新调整参数反复处理。
  5. 导出保存: 复制结果到剪贴板或下载为文件。支持多种输出格式供选择,满足不同使用场景和工作流程的需要。

整个操作过程完全在您的浏览器中完成,数据不会被上传到任何远程服务器。

关于此工具

正则表达式速查表是DevToolkit提供的专业在线参考工具。它完全在浏览器中运行,不需要安装任何软件或创建账户。工具使用现代Web技术(JavaScript和WebAssembly)实现高性能处理,同时确保您的数据始终留在本地设备上,隐私安全有保障。

工具的核心处理引擎经过精心优化,能够快速准确地完成各种复杂操作。用户界面采用直观的设计,即使是首次使用的用户也能轻松上手。响应式布局确保在桌面电脑、平板和手机上都有良好的操作体验和显示效果。

作为DevToolkit工具集的一部分,正则表达式速查表与其他参考工具无缝衔接。您可以将一个工具的输出直接用作另一个工具的输入,构建高效的数据处理工作流。所有工具共享相同的设计理念:免费使用、极速处理、隐私安全优先。

为什么使用此工具

选择正则表达式速查表作为您的在线参考工具的理由:

  • 即开即用: 无需下载安装任何软件,打开浏览器即可立即使用正则表达式速查表。适合临时需求和跨设备使用的各种场景。
  • 隐私安全: 所有数据处理在浏览器本地完成,您的数据不会被上传到外部服务器。适合处理各类敏感和机密数据内容。
  • 专业品质: 使用行业标准的算法和规范实现,输出结果准确可靠,完全可以用于正式的生产环境和商业项目。
  • 完全免费: 所有功能完全免费使用,没有任何使用次数限制、输出水印或高级功能付费门槛。
  • 跨平台兼容: 支持Windows、macOS、Linux和移动设备上的所有现代主流浏览器。一次使用,处处运行,无需考虑设备差异。
  • 持续更新: DevToolkit团队定期优化正则表达式速查表的处理算法和界面交互,确保工具始终提供最佳的使用体验和处理效果。

常见问题

可以复制正则表达式速查表的内容吗?
可以。每个正则模式旁有复制按钮——一键复制模式字符串。也可复制完整的模式连带解释。方便粘贴到代码编辑器、搜索工具或正则测试器中直接使用。
可以按关键词快速搜索内容吗?
正则表达式速查表 — 支持全文搜索功能。在搜索框输入命令名、参数或功能描述即可过滤相关内容。搜索支持模糊匹配和拼音首字母匹配。常用命令和高频查询会优先排序。也可以通过分类标签浏览特定类别的内容。
正则表达式速查表能离线使用吗?
页面加载后完全离线使用。所有内容在HTML中预渲染,搜索和筛选用JavaScript本地执行。不需要网络请求。适合在没有网络的环境中作为离线参考手册。
正则表达式速查表的收录范围有多广?
覆盖字符类、量词、锚点、分组/捕获、前瞻/后瞻、命名组和Unicode属性等完整语法。包含30+实战模式(email、URL、IP地址、日期等)。标注JavaScript/Python/Java之间的差异。
正则表达式速查表的信息有多新?
核心正则语法相对稳定(PCRE/ECMAScript标准已成熟)。定期更新新增的语言特性——如JavaScript的命名捕获组、Unicode属性转义(\p{...})等较新特性的说明。