Skip to main content
DevTools24

Regex 构建器

使用模式模块可视化构建正则表达式。组合模式和量词,实时测试。

/.../g

Regular Expressions - 技术详情

Regular expressions are patterns used to match character combinations in strings. Build patterns with character classes (\\d, \\w, \\s), quantifiers (+, *, ?), anchors (^, $), and groups. Test your patterns against sample text.

命令行替代方案

// Common regex patterns\n/^[\\w.-]+@[\\w.-]+\\.[a-z]{2,}$/i  // email\n/^\\d{3}-\\d{3}-\\d{4}$/           // phone\n/^https?:\\/\\/.+/                  // URL

参考

查看官方规范