cheat_sheets_regex
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cheat_sheets_regex [2022/09/25 14:27] – [RegEx] gman | cheat_sheets_regex [2023/02/11 14:34] (current) – [Groups and Ranges] gman | ||
---|---|---|---|
Line 48: | Line 48: | ||
| [A-Q] | Upper case letter from A to Q | | | [A-Q] | Upper case letter from A to Q | | ||
| [0-7] | Digit from 0 to 7 | | | [0-7] | Digit from 0 to 7 | | ||
+ | |||
+ | Use a group to " | ||
+ | * '' | ||
+ | * The parentheses are used to create " | ||
+ | * NOTE: in **gedit** you reference with a backslash: '' | ||
+ | * See the follow table regarding **string replacements**. | ||
---- | ---- | ||
Line 53: | Line 59: | ||
===== String Replacement ===== | ===== String Replacement ===== | ||
- | ^ Syntax | + | ^ Syntax |
- | | $n | nth non-passive group | | + | | $n | nth non-passive group |
- | | $2 | " | + | | $2 | %%" |
- | | $1 | " | + | | $1 | %%" |
- | | $` | Before matched string | | + | | $` | Before matched string |
- | | $' | + | | $' |
- | | $+ | Last matched string | | + | | $+ | Last matched string |
- | | $& | + | | $& |
**Note:** Some regex implementations use \ instead of $. | **Note:** Some regex implementations use \ instead of $. | ||
Line 68: | Line 74: | ||
===== Character Classes ===== | ===== Character Classes ===== | ||
- | ^ Syntax | + | ^ Syntax |
| \c | Control character | | | \c | Control character | | ||
- | | \s | White space | | + | | \s | White space |
- | | \S | Not white space | | + | | \S | Not white space |
- | | \d | Digit | | + | | \d | Digit |
- | | \D | Not digit | | + | | \D | Not digit |
- | | \w | Word | | + | | \w | Word | |
- | | \W | Not word | | + | | \W | Not word | |
| \x | Hexadecimal digit | | | \x | Hexadecimal digit | | ||
- | | \O | Octal digit | | + | | \O | Octal digit |
---- | ---- | ||
Line 83: | Line 89: | ||
===== POSIX ===== | ===== POSIX ===== | ||
- | ^ Syntax | + | ^ Syntax |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
- | | [: | + | | [: |
+ | |||
+ | ---- | ||
- | --- |
cheat_sheets_regex.1664116033.txt.gz · Last modified: by gman