This page describes regular expressions that can be used for Conversions (convert) of config.yml.
Character class
Regular expression | Description |
---|
. | An arbitrary character (except new-line characters) |
[] | Any one of the characters Example) [xyz], [x-z] |
[^] | None of the characters Example) [^xyz], [^x-z] |
\d | Decimal digit [0-9] |
\D | Non-decimal digit [^0-9] |
\w | Word constituent character [a-zA-Z0-9_] |
\W | Non-word constituent character [^a-zA-Z0-9_] |
\s | Space character [ \t\r\n\f] |
\S | Non-space character [^ \t\r\n\f] |
Repetition
Regular expression | Description |
---|
* | 0 times or more (longest match) |
+ | 1 time or more (longest match) |
? | 0 times or 1 time (longest match) |
{n} | Just n times (n is a numeric character) |
{n,} | n times or more (n is a numeric character) (longest match) |
{n,m} | At least n and at most m times (n and m are numeric characters) (longest match) |
*? | 0 times or more (shortest match) |
+? | 1 time or more (shortest match) |
?? | 0 times or 1 time (shortest match) |
{n}? | Just n times (n is a numeric character) |
{n,}? | n times or more (n is a numeric character) (shortest match) |
{n,m}? | At least n and at most m times (n and m are numeric characters) (shortest match) |
Capture and grouping
Regular expression | Description |
---|
(pat) | Regular capture and grouping |
(?:pat) | Grouping without capturing |
Selector
Regular expression | Description |
---|
pat1|pat2 | Either matches |
Anchor
Regular expression | Description |
---|
^ | Match the line head |
$ | Match the line end |
\A | Match the head of a string |
\z | Match the end of a string |
\b | Match word boundary |
\B | Match non-word boundary |