Install
openclaw skills install regexWrite correct, efficient regular expressions across different engines.
openclaw skills install regex.* is greedy—matches as much as possible; .*? is lazy—matches minimum<.*> on <a>b</a> matches entire string, not <a>+ * {n,} are greedy—add ? for lazy: +? *? {n,}?\. \* \+ \? \[ \] \( \) \{ \} \| \\ \^ \$[]: only ], \, ^, - need escape (and ^ only at start, - only mid)\\ in regex, but in strings often need \\\\ (double escape)^ start, $ end—but behavior changes with multiline flag^ $ match line starts/ends; without, only string start/end\A always string start, \Z always string end (not all engines)\b matches position, not character—\bword\b for whole words[abc] matches one of a, b, c; [^abc] matches anything except a, b, c[a-z] [0-9]—but [a-Z] is invalid (ASCII order matters)\d digit, \w word char, \s whitespace; uppercase negates: \D \W \S. matches any char except newline—use [\s\S] for truly any, or s flag if available() vs non-capturing (?:)—use (?:) when you don't need backreference(?<name>...) or (?P<name>...) depending on engine\1 \2 refer to captured groups in same patterncat|dog vs ca(t|d)og(?=...): assert what follows, don't consume(?!...): assert what doesn't follow(?<=...): assert what precedes(?<!...): assert what doesn't precede* or + insidei case-insensitive, m multiline (^$ match lines), g global (find all)s (dotall): . matches newline—not supported everywhereu unicode: enables \p{} properties, proper surrogate handling/pattern/flags (JS), (?flags) inline, or function arg (Python re.I)\A \Z; no possessive quantifiersre: uses (?P<name>) for named groups; no \p{} without regex module++ *+; recursive patterns(a+)+ against aaaaaaaaaab is exponential—avoid nested quantifiers++ *+ prevent backtracking—use when backtracking pointless(?>...) don't give back chars—similar to possessive^prefix is O(1), unanchored prefix is O(n)