←
RegEx 生成器
正则表达式 (Pattern)
//g
实时测试与匹配沙盒
智能 POSIX 积木
实战代码片段
定义正则
const regex = /[a-zA-Z0-9]+/g;判断布尔值
const isMatch = regex.test(text);提取单一匹配
const firstMatch = text.match(regex)?.[0];提取所有匹配 (数组)
const allMatches = [...text.matchAll(regex)].map(m => m[0]);