Regular expressions Pattern matching syntax
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
abc.\d+[a-z]^...$a|b(...)colou?rConcepts
- Anchor ^ \b \A
- Atom a . \d [abc] (...)
- Quantifier ? * + {n,m}
- Alternation a|b
Characters
.\d \w \s[abc][^abc][a-z0-9]\.\n \t \r\x41 \x{263A}[[:alpha:]]\h \v \R\Q...\E\p{L} \p{Lu}\p{Greek}Quantifiers
*+?{n}{n,m}{n,}*? +? ??*+ ++ ?+
Anchors
^ $\b\B\A \z\Z\GGroups
(...)a|b(?:...)(?<name>...)
\1 \2\k<name>(?>...)(?|...)(?#...)Lookaround
(?=...)(?!...)(?<=...)(?<!...)\K| Syntax | Asserts |
|---|---|
(?=x) |
x comes next |
(?!x) |
x does not come next |
(?<=x) |
x comes before |
(?<!x) |
x does not come before |
Flags
(?i)(?m)(?s)(?x)(?i:...)(?-i)(?U)(*UCP)Advanced
(?R)(?1) (?&name)
(?(1)yes|no)(?(DEFINE)...)(*SKIP)(*FAIL)(*ACCEPT)Recipes
^-?\d+(?:\.\d+)?$
(?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2})
# match, replace with nothing[ \t]+$ (with (?m))
# match only the numberprice=\K\d+# or with lookbehind(?<=price=)\d+
^[\w.+-]+@[\w-]+(?:\.[\w-]+)+$



