mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-05 22:44:37 +00:00
39 lines
678 B
Plaintext
39 lines
678 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# regex
|
|
|
|
> Regular expressions (`regex`) are patterns used to match, search, and manipulate text.
|
|
> `regex` isn't a command, but syntax to be used with other commands.
|
|
> More information: <https://cheatography.com/davechild/cheat-sheets/regular-expressions/>.
|
|
|
|
- Match any single character:
|
|
|
|
`.`
|
|
|
|
- Match the start of a line:
|
|
|
|
`^{{hello}}`
|
|
|
|
- Match the end of a line:
|
|
|
|
`{{world}}$`
|
|
|
|
- Match zero or more repeated characters:
|
|
|
|
`{{a}}*`
|
|
|
|
- Match a set of characters:
|
|
|
|
`[{{abc}}]`
|
|
|
|
- Match a range of characters:
|
|
|
|
`[{{a-z3-9}}]`
|
|
|
|
- Match anything but the specified character:
|
|
|
|
`[^{{a}}]`
|