Skip to content

Commit 398ba8d

Browse files
FazleArefinsebastiaanspeckManagormsaf9
authored
grex: add example (#19459)
* grex: add example * Update grex command examples for clarity * Update grex.md Co-authored-by: Managor <[email protected]> * Update grex.md * Update pages/common/grex.md --------- Co-authored-by: Sebastiaan Speck <[email protected]> Co-authored-by: Managor <[email protected]> Co-authored-by: Sahil Afrid Farookhi <[email protected]>
1 parent 8987c4e commit 398ba8d

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

pages/common/grex.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,32 @@
55
66
- Generate a simple `regex`:
77

8-
`grex {{space_separated_strings}}`
8+
`grex {{string1 string2 ...}}`
99

1010
- Generate a case-insensitive `regex`:
1111

12-
`grex {{[-i|--ignore-case]}} {{space_separated_strings}}`
12+
`grex {{[-i|--ignore-case]}} {{string1 string2 ...}}`
1313

14-
- Replace digits with '\d':
14+
- Replace digits with `\d`:
1515

16-
`grex {{[-d|--digits]}} {{space_separated_strings}}`
16+
`grex {{[-d|--digits]}} {{string1 string2 ...}}`
1717

18-
- Replace Unicode word character with '\w':
18+
- Replace Unicode word character with `\w`:
1919

20-
`grex {{[-w|--words]}} {{space_separated_strings}}`
20+
`grex {{[-w|--words]}} {{string1 string2 ...}}`
2121

22-
- Replace spaces with '\s':
22+
- Replace spaces with `\s`:
2323

24-
`grex {{[-s|--spaces]}} {{space_separated_strings}}`
24+
`grex {{[-s|--spaces]}} {{string1 string2 ...}}`
2525

26-
- Add {min, max} quantifier representation for repeating sub-strings:
26+
- Detect repeating patterns in the input and shorten them using {min,max} quantifiers:
2727

28-
`grex {{[-r|--repetitions]}} {{space_separated_strings}}`
28+
`grex {{[-r|--repetitions]}} {{string1 string2 ...}}`
29+
30+
- Generate `regex` of test cases (separated by newline) from a file:
31+
32+
`grex {{[-f|--file]}} {{path/to/file}}`
33+
34+
- Do not generate anchors and non-capture groups:
35+
36+
`grex --no-anchors {{[-g|--capture-groups]}} {{string1 string2 ...}}`

0 commit comments

Comments
 (0)