2020-10-03 00:56:46 +05:30
|
|
|
# grex
|
|
|
|
|
2023-07-16 19:23:40 +02:00
|
|
|
> Generate regular expressions.
|
2020-10-03 00:56:46 +05:30
|
|
|
> More information: <https://github.com/pemistahl/grex>.
|
|
|
|
|
|
|
|
- Generate a simple regular expression:
|
|
|
|
|
2023-12-27 03:41:30 -03:00
|
|
|
`grex {{space_separated_strings}}`
|
2020-10-03 00:56:46 +05:30
|
|
|
|
2021-05-10 11:03:12 +02:00
|
|
|
- Generate a case-insensitive regular expression:
|
2020-10-03 00:56:46 +05:30
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`grex {{[-i|--ignore-case]}} {{space_separated_strings}}`
|
2020-10-03 00:56:46 +05:30
|
|
|
|
|
|
|
- Replace digits with '\d':
|
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`grex {{[-d|--digits]}} {{space_separated_strings}}`
|
2020-10-03 00:56:46 +05:30
|
|
|
|
2021-05-20 16:13:41 -04:00
|
|
|
- Replace Unicode word character with '\w':
|
2020-10-03 00:56:46 +05:30
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`grex {{[-w|--words]}} {{space_separated_strings}}`
|
2020-10-03 00:56:46 +05:30
|
|
|
|
|
|
|
- Replace spaces with '\s':
|
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`grex {{[-s|--spaces]}} {{space_separated_strings}}`
|
2020-10-03 00:56:46 +05:30
|
|
|
|
|
|
|
- Add {min, max} quantifier representation for repeating sub-strings:
|
|
|
|
|
2025-04-22 15:48:30 +03:00
|
|
|
`grex {{[-r|--repetitions]}} {{space_separated_strings}}`
|