regex-master
Skill0 starsChanged 3 months agoMITView on GitHub
正则表达式速查:元字符、分组、断言、Pythonre模块、常用模式.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- xcrrr/claude-skillstheir own version, first seen Mar 19, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- xcrrr/claude-skills★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository219 other files it gives its agents.
- agent-doctrineSkill
- agent-evaluation-frameworkSkill
- agent-visualization-flintSkill
- hermes-agentSkill
- bailian-cliSkill
- edge-browser-automationSkill
- computer-useSkill
- jupyter-live-kernelSkill
- backup-strategiesSkill
- browser-automationSkill
- chinese-ai-free-apiSkill
- cicd-pipeline-templatesSkill
- copybaraSkill
- devops-toolkitSkill
- email-deliverabilitySkill
- monitoring-observabilitySkill
- obsidian-maintenanceSkill
- obsidian-troubleshootingSkill
- openclaw-windowsSkill
- openclaw-workerSkill
- webhook-subscriptionsSkill
- windows-dev-environmentSkill
- windows-masterSkill
- zero-downtime-deploySkill
- codebase-inspectionSkill
- github-workflowSkill
- adaptive-communicationSkill
- agent-cost-dashboardSkill
- agent-evolutionSkill
- agent-governanceSkill
- agent-osSkill
- context-efficient-toolsSkill
- context-loss-awarenessSkill
- creative-synthesisSkill
- hermes-desktop-pluginsSkill
- emotional-intelligenceSkill
- graph-engineering-workflowSkill
- hermes-maintenanceSkill
- hermes-voiceSkill
- hermes-hygieneSkill
- identity-coreSkill
- income-loopSkill
- master-synthesisSkill
- meta-cognitionSkill
- reasoning-engineSkill
- self-preservationSkill
- teaching-abilitySkill
- temporal-awarenessSkill
- hermes-themesSkill
- thinking-visualizationSkill
- user-modelingSkill
- voice-full-restoreSkill
- knowledge-graph-traversalSkill
- mcp-browser-canvasSkill
- free-api-gatewaySkill
- native-mcpSkill
- web-reverse-apiSkill
- ai-edaSkill
- huggingface-hubSkill
- industrial-ai-siemens-mcpSkill
- The first 60 shown.
The file
Files
正则表达式速查
借鉴 ziishaned/learn-regex (46k⭐)。
基础元字符
| 符号 | 含义 | 示例 |
. | 任意字符(除换行) | h.t → hat, hit, hot |
* | 前一个字符0次或多次 | ab*c → ac, abc, abbc |
+ | 前一个字符1次或多次 | ab+c → abc, abbc |
? | 前一个字符0或1次 | colou?r → color, colour |
{n} | 恰好n次 | a{3} → aaa |
{n,} | 至少n次 | a{2,} → aa, aaa, aaaa |
{n,m} | n到m次 | a{2,4} → aa, aaa, aaaa |
^ | 行首 | ^Hello |
$ | 行尾 | world$ |
\d | 数字 [0-9] | \d+ → 123 |
\w | 单词字符 [a-zA-Z0-9_] | |
\s | 空白字符 | |
\D | 非数字 | |
\W | 非单词字符 | |
\S | 非空白 |
字符类
[abc] a或b或c
[^abc] 不是a、b、c
[a-z] a到z
[0-9] 0到9
[a-zA-Z] 所有字母分组与引用
(cat|dog) cat或dog
(ha)+ ha, haha, hahaha
\1 引用第一个分组断言(不消耗字符)
(?=...) 正向先行断言: 后面是...
(?!...) 负向先行断言: 后面不是...
(?<=...) 正向后行断言: 前面是...
(?<!...) 负向后行断言: 前面不是...
\w+(?=@) 匹配 @ 前面的用户名
(?<=\$)\d+ 匹配 $ 后面的数字Python re 模块
import re
# 搜索(返回匹配对象或None)
m = re.search(r'\d+', 'abc123def')
m.group() # '123'
# 查找所有(返回列表)
re.findall(r'\d+', 'a1b2c3') # ['1', '2', '3']
# 替换
re.sub(r'\s+', ' ', 'a b c') # 'a b c'
# 分割
re.split(r'[,;]', 'a,b;c') # ['a', 'b', 'c']
# 编译(重复用更快)
pattern = re.compile(r'\d+')
pattern.findall('a1b2c3')常用模式
# 邮箱(宽松版)
r'[\w.+-]+@[\w-]+\.[\w.-]+'
# 手机号(中国)
r'1[3-9]\d{9}'
# 身份证
r'\d{17}[\dXx]'
# URL
r'https?://[\w./-]+'
# IP 地址
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
# 中文
r'[\u4e00-\u9fff]+'
# 提取引号内容
r'"([^"]*)"'
r"'([^']*)'"
# 去除 HTML 标签
re.sub(r'<[^>]+>', '', html)标志
re.IGNORECASE # 忽略大小写
re.MULTILINE # ^$ 匹配每行首尾
re.DOTALL # . 匹配换行
re.VERBOSE # 允许注释和空白
# 组合
re.search(r'hello', text, re.IGNORECASE | re.MULTILINE)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

