1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-09 23:35:44 +02:00
tldr/pages/common/grex.md

29 lines
645 B
Markdown
Raw Normal View History

2020-10-03 00:56:46 +05:30
# grex
> Generate `regex`s.
2020-10-03 00:56:46 +05:30
> More information: <https://github.com/pemistahl/grex>.
- Generate a simple `regex`:
2020-10-03 00:56:46 +05:30
`grex {{space_separated_strings}}`
2020-10-03 00:56:46 +05:30
- Generate a case-insensitive `regex`:
2020-10-03 00:56:46 +05:30
`grex {{[-i|--ignore-case]}} {{space_separated_strings}}`
2020-10-03 00:56:46 +05:30
- Replace digits with '\d':
`grex {{[-d|--digits]}} {{space_separated_strings}}`
2020-10-03 00:56:46 +05:30
- Replace Unicode word character with '\w':
2020-10-03 00:56:46 +05:30
`grex {{[-w|--words]}} {{space_separated_strings}}`
2020-10-03 00:56:46 +05:30
- Replace spaces with '\s':
`grex {{[-s|--spaces]}} {{space_separated_strings}}`
2020-10-03 00:56:46 +05:30
- Add {min, max} quantifier representation for repeating sub-strings:
`grex {{[-r|--repetitions]}} {{space_separated_strings}}`