1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-05 14:55:24 +02:00
tldr/pages/common/grex.md

29 lines
678 B
Markdown
Raw Normal View History

2020-10-03 00:56:46 +05:30
# grex
> Generate regular expressions.
2020-10-03 00:56:46 +05:30
> More information: <https://github.com/pemistahl/grex>.
- Generate a simple regular expression:
`grex {{space_separated_strings}}`
2020-10-03 00:56:46 +05:30
- Generate a case-insensitive regular expression:
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}}`