2021-02-25 12:46:24 -05:00
|
|
|
# exrex
|
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
> Generate all/random matching strings for a `regex`.
|
|
|
|
> It can also simplify `regex`es.
|
2021-02-25 12:46:24 -05:00
|
|
|
> More information: <https://github.com/asciimoo/exrex>.
|
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
- Generate all possible strings that match a `regex`:
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
`exrex '{{regex}}'`
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
- Generate a random string that matches a `regex`:
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-26 08:04:05 +03:00
|
|
|
`exrex {{[-r|--random]}} '{{regex}}'`
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
- Generate at most 100 strings that match a `regex`:
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-26 08:04:05 +03:00
|
|
|
`exrex {{[-m|--max-number]}} {{100}} '{{regex}}'`
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
- Generate all possible strings that match a `regex`, joined by a custom delimiter string:
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-26 08:04:05 +03:00
|
|
|
`exrex {{[-d|--delimiter]}} "{{, }}" '{{regex}}'`
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
- Print count of all possible strings that match a `regex`:
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-26 08:04:05 +03:00
|
|
|
`exrex {{[-c|--count]}} '{{regex}}'`
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-25 08:50:06 +03:00
|
|
|
- Simplify a `regex`:
|
2021-02-25 12:46:24 -05:00
|
|
|
|
2025-07-26 08:04:05 +03:00
|
|
|
`exrex {{[-s|--simplify]}} '{{ab|ac}}'`
|
2021-02-25 12:46:24 -05:00
|
|
|
|
|
|
|
- Print eyes:
|
|
|
|
|
|
|
|
`exrex '{{[oO0](_)[oO0]}}'`
|
|
|
|
|
|
|
|
- Print a boat:
|
|
|
|
|
|
|
|
`exrex '{{( {20}(\| *\\|-{22}|\|)|\.={50}| ( ){0,5}\\\.| {12}~{39})}}'`
|