Skip to content

Commit

Permalink
docs: update usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
Lai-YT committed Aug 2, 2023
1 parent 41670a2 commit f5ae149
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ $ bin/regexp -h # or --help
```
regexp
Usage: regexp [-h] [-V] [-g regexp [-o FILE]] [[-c] regexp string]
Usage: regexp [-h] [-V] {-g regexp [-o FILE] | [-c] regexp string}
Description: Regular expression implementation.
Supports . ( ) | * + ?. No escapes.
Compiles to NFA and then simulates NFA using Thompson's algorithm.
One can either graph the regexp or match a string.
One can either match a string (default) or graph the regexp.
See the following options.
Notice that character # can't appear in the regular expression,
it's reserved technically as the special character.
Expand All @@ -90,6 +90,14 @@ Options:
-h, --help Shows this help message and exit
-V, --version Shows regexp version and exit
Match mode:
Matches the string with the regular expression,
exits with 1 if regexp is ill-formed or it does not match
-c, --cache Caches NFA states to build DFA on the fly
regexp The regular expression to use on matching
string The string to be matched
Graph mode:
Converts the regular expression into a graph,
exits with 1 if regexp is ill-formed or the file can't be opened
Expand All @@ -102,14 +110,6 @@ Graph mode:
(default: nfa)
regexp The regular expression to be converted
Match mode:
Matches the string with the regular expression,
exits with 1 if regexp is ill-formed or it does not match
-c, --cache Caches NFA states to build DFA on the fly
regexp The regular expression to use on matching
string The string to be matched
Written by: Lai-YT
regexp version: 1.0.2
Expand Down

0 comments on commit f5ae149

Please sign in to comment.