CreeperJIMM's icon苦力怕怕

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]);

喜欢这个工具吗?

快分享给好友使用吧!

反馈与支持

若遇到 Bug 欢迎反馈,或赞助我一杯咖啡!