diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2023-11-25 14:57:19 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2023-11-25 14:57:19 -0500 |
| commit | e6e482054de77f3fe5d65344da86065373cf5f23 (patch) | |
| tree | a6876c73bccf490512be5ff93fa808f3ce8d1c95 /README.md | |
| parent | e0a55ba6176df325b65b1768bba929805444bf88 (diff) | |
Deprecate '-p' flag and replace backslash interpolation with curly brace
interpolation
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -13,8 +13,14 @@ Run `make tutorial` to run through the tutorial. It walks through some basic pat ## Usage -`bp [flags] <pattern> [<input files>...]` +``` +bp [flags] <pattern> [<input files>...] +``` +BP is optimized for matching literal strings, so the main pattern argument is +interpreted as a string literal. BP pattern syntax is inserted using curly +brace interpolations like `bp 'foo{..}baz'` (match the string literal "foo" up +to and including the next occurrence of "baz" on the same line). ### Flags @@ -25,7 +31,6 @@ Run `make tutorial` to run through the tutorial. It walks through some basic pat * `-e` `--explain` print an explanation of the matches * `-j` `--json` print matches as JSON objects * `-l` `--list-files` print only filenames containing matches -* `-p` `--pattern <pat>` provide a pattern (equivalent to `bp '\(<pat>)'`) * `-r` `--replace <replacement>` replace the input pattern with the given replacement * `-s` `--skip <skip pattern>` skip over the given pattern when looking for matches * `-B` `--context-before <N>` change how many lines of context are printed before each match |
