diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-11 02:04:01 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-11 02:04:01 -0700 |
| commit | 0c20c39f410d1d76123e8f5318e0624f34cf7908 (patch) | |
| tree | a271dd7a4274e67f34d016b946ef3e1a007746b0 /bpeg.c | |
| parent | f64467af21efab70b8cfab46f3f7f9d36c5b6e5f (diff) | |
Made more grep-like
Diffstat (limited to 'bpeg.c')
| -rw-r--r-- | bpeg.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -110,7 +110,10 @@ int main(int argc, char *argv[]) add_def(g, pattern, "pattern", pat); - const char *grammar = "find = *(@pattern / \\n / .);"; + const char *grammar = ( + "find-all = *(matching-line / {&&(\\n/$$)=>});\n" + "matching-line = +&@pattern *. $ ?\\n;" + ); load_grammar(g, grammar); } @@ -138,7 +141,7 @@ int main(int argc, char *argv[]) return 1; } else { print_match(m, "\033[0m", verbose); - printf("\033[0;2m%s\n", m->end); + //printf("\033[0;2m%s\n", m->end); } return 0; |
