skills/built-in/regex/SKILL.md
Write, explain, test, and debug regular expressions, and build them iteratively against real sample input. Use when users want a regex/pattern to match or extract text, ask why a pattern isn't matching, need to validate emails/URLs/dates/phone numbers, or want to do find-and-replace with capture groups. Triggers on mentions of regex, regular expression, pattern, match, extract, validate, find and replace, 正则, 正则表达式, 匹配, 提取, 替换.
npx skillsauth add microclaw/microclaw regexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Never hand-wave a regex — test it against real samples before handing it over. A pattern that "looks right" but fails on the user's actual input is worse than no pattern.
python3 - <<'PY'
import re
pat = r'\b\d{4}-\d{2}-\d{2}\b'
samples = ["due 2026-05-31 ok", "no date", "2026/05/31 wrong sep"]
for s in samples:
print(repr(s), "->", re.findall(pat, s))
PY
python3 - <<'PY'
import re
m = re.search(r'(?P<user>[\w.+-]+)@(?P<domain>[\w.-]+)', "ping [email protected]")
print(m.groupdict() if m else "no match")
PY
python3 - <<'PY'
import re
print(re.sub(r'(\d{4})-(\d{2})-(\d{2})', r'\3/\2/\1', "2026-05-31")) # -> 31/05/2026
PY
^ start, $ end, \b word boundary.\d digit, \w word char, \s space; negate with uppercase \D \W \S.* 0+, + 1+, ? 0/1, {m,n}; add ? for lazy (.*?).(...) capture, (?:...) non-capture, (?P<name>...) named.(?=...), (?!...), (?<=...), (?<!...).re.VERBOSE for
complex patterns and comment them.(a+)+) on untrusted input.documentation
Improve or write prose: tighten, clarify, fix grammar, and adjust tone/length while preserving the author's voice and meaning. Use when users ask to edit, proofread, rewrite, polish, shorten, or change the tone of text, or to draft something from notes. Triggers on mentions of edit, proofread, rewrite, polish, tighten, make it shorter/clearer/more formal, fix grammar, 润色, 改写, 校对, 修改, 精简, 改语气, 帮我写.
development
Look up a quick factual summary of a topic, person, place, or thing from Wikipedia via its public REST API (no API key). Use when users want a concise overview, 'who/what is X', background, or a definition-level explanation of a named entity. Triggers on mentions of who is, what is, tell me about, overview of, background on, wikipedia, 是谁, 是什么, 介绍一下, 简介, 维基.
testing
Convert between units of measurement precisely: length, mass/weight, temperature, area, volume, speed, data sizes, and time. Use when users ask to convert X to Y, 'how many cm in an inch', 'what's 70F in C', 'GB to MB', or mix metric and imperial. Triggers on mentions of convert, conversion, in inches/cm/km/miles, kg/lb, Celsius/Fahrenheit, 换算, 转换, 多少厘米, 多少公斤, 摄氏, 华氏.
development
Translate text between languages naturally, preserving meaning, tone, and formatting, with notes on nuance or ambiguity when it matters. Use when users ask to translate text, say something in another language, or localize a message. Triggers on mentions of translate, in English/Chinese/Spanish/Japanese/etc, how do you say, localize, 翻译, 译成, 用英文怎么说, 中译英, 英译中, 本地化.