Regex Tester

Online regex testing tool with real-time matching, highlighting, and group capture

//
Test Text

Common Regex Library

Click a regex to load it into the input fields for testing

正则测试 - Free Online Tool

^1[3-9]\\d{9}$正则表达式在线测试13812345678
^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$邮箱地址user@example.com
^\\d{17}[\\dXx]$18位身份证号110101199001011234
^(http|https)://[\\w\\-]+(\\.\\w+)+[/\\w\\-./?%&=]*$HTTP/HTTPS URLhttps://www.example.com
^1\\.([0-9]|[0-9][0-9])$IP地址(简化版)192.168.1.1

正则测试 - Free Online Tool

(https?|ftp)://[\\w\\-./?%&=#]+提取URL链接https://jsjson.com
[\\w.-]+@[\\w.-]+\\.\\w+提取邮箱地址contact@example.com
1[3-9]\\d{9}提取手机号13812345678
\\d{4}-\\d{2}-\\d{2}提取日期 (yyyy-mm-dd)2024-01-15
\\d{17}[\\dXx]提取身份证号110101199001011234

正则测试 - Free Online Tool

\\s+匹配空白字符(用于替换移除)多余 空格
[\\u4e00-\\u9fa5]匹配中文字符abc中文def
[a-zA-Z]+匹配英文字母123abc456
\\d+匹配数字abc123def456
[\\u4e00-\\u9fa5a-zA-Z0-9]匹配中文+英文+数字Hello世界123

Regex Tester Usage Guide

Key Features

  • Real-time Matching - Input and match instantly
  • Group Capture - Display all captured group content
  • Highlight Preview - Highlight matches in the original text
  • Flag Toggle - Quickly toggle g/i/m/s flags

Common Regex

  • ^\w+@\w+\.\w+$ - Email validation
  • ^1[3-9]\d{9}$ - Phone number validation
  • https?://\S+ - URL extraction
  • \d{4}-\d{2}-\d{2} - Date matching

常见问题

相关工具