Rewording
This commit is contained in:
parent
c1c4f2109b
commit
ee8fb64e97
64
bp.1
64
bp.1
@ -1,5 +1,19 @@
|
|||||||
.\" Automatically generated by Pandoc 2.14.2
|
.\" Automatically generated by Pandoc 2.17.1.1
|
||||||
.\"
|
.\"
|
||||||
|
.\" Define V font for inline verbatim, using C font in formats
|
||||||
|
.\" that render this, and otherwise B font.
|
||||||
|
.ie "\f[CB]x\f[]"x" \{\
|
||||||
|
. ftr V B
|
||||||
|
. ftr VI BI
|
||||||
|
. ftr VB B
|
||||||
|
. ftr VBI BI
|
||||||
|
.\}
|
||||||
|
.el \{\
|
||||||
|
. ftr V CR
|
||||||
|
. ftr VI CI
|
||||||
|
. ftr VB CB
|
||||||
|
. ftr VBI CBI
|
||||||
|
.\}
|
||||||
.TH "BP" "1" "May 17 2021" "" ""
|
.TH "BP" "1" "May 17 2021" "" ""
|
||||||
.hy
|
.hy
|
||||||
.SH NAME
|
.SH NAME
|
||||||
@ -20,8 +34,8 @@ Give a pattern in BP syntax instead of string syntax (equivalent to
|
|||||||
\f[B]bp \[aq]\[rs](pat)\[aq]\f[R]
|
\f[B]bp \[aq]\[rs](pat)\[aq]\f[R]
|
||||||
.TP
|
.TP
|
||||||
\f[B]-w\f[R], \f[B]--word\f[R] \f[I]word\f[R]
|
\f[B]-w\f[R], \f[B]--word\f[R] \f[I]word\f[R]
|
||||||
Surround a string pattern with word boundaries (equivalent to
|
Surround a string pattern with word boundaries (equivalent to \f[B]bp
|
||||||
\f[B]bp \[aq]\[rs]|word\[rs]|\[aq]\f[R])
|
\[aq]\[rs]|word\[rs]|\[aq]\f[R])
|
||||||
.TP
|
.TP
|
||||||
\f[B]-e\f[R], \f[B]--explain\f[R]
|
\f[B]-e\f[R], \f[B]--explain\f[R]
|
||||||
Print a visual explanation of the matches.
|
Print a visual explanation of the matches.
|
||||||
@ -213,8 +227,8 @@ Not \f[I]pat\f[R]
|
|||||||
Maybe \f[I]pat\f[R]
|
Maybe \f[I]pat\f[R]
|
||||||
.TP
|
.TP
|
||||||
\f[I]N\f[R] \f[I]pat\f[R]
|
\f[I]N\f[R] \f[I]pat\f[R]
|
||||||
Exactly \f[I]N\f[R] repetitions of \f[I]pat\f[R]
|
Exactly \f[I]N\f[R] repetitions of \f[I]pat\f[R] (e.g.\ \f[B]5
|
||||||
(e.g.\ \f[B]5 \[dq]x\[dq]\f[R] matches \f[B]\[lq]xxxxx\[rq]\f[R])
|
\[dq]x\[dq]\f[R] matches \f[B]\[lq]xxxxx\[rq]\f[R])
|
||||||
.TP
|
.TP
|
||||||
\f[I]N\f[R] \f[B]-\f[R] \f[I]M\f[R] \f[I]pat\f[R]
|
\f[I]N\f[R] \f[B]-\f[R] \f[I]M\f[R] \f[I]pat\f[R]
|
||||||
Between \f[I]N\f[R] and \f[I]M\f[R] repetitions of \f[I]pat\f[R]
|
Between \f[I]N\f[R] and \f[I]M\f[R] repetitions of \f[I]pat\f[R]
|
||||||
@ -222,17 +236,17 @@ Between \f[I]N\f[R] and \f[I]M\f[R] repetitions of \f[I]pat\f[R]
|
|||||||
\f[B]\[lq]xxx\[rq]\f[R])
|
\f[B]\[lq]xxx\[rq]\f[R])
|
||||||
.TP
|
.TP
|
||||||
\f[I]N\f[R]\f[B]+\f[R] \f[I]pat\f[R]
|
\f[I]N\f[R]\f[B]+\f[R] \f[I]pat\f[R]
|
||||||
At least \f[I]N\f[R] or more repetitions of \f[I]pat\f[R]
|
At least \f[I]N\f[R] or more repetitions of \f[I]pat\f[R] (e.g.\ \f[B]2+
|
||||||
(e.g.\ \f[B]2+ \[dq]x\[dq]\f[R] matches \f[B]\[lq]xx\[rq]\f[R],
|
\[dq]x\[dq]\f[R] matches \f[B]\[lq]xx\[rq]\f[R],
|
||||||
\f[B]\[lq]xxx\[rq]\f[R], \f[B]\[lq]xxxx\[rq]\f[R], etc.)
|
\f[B]\[lq]xxx\[rq]\f[R], \f[B]\[lq]xxxx\[rq]\f[R], etc.)
|
||||||
.TP
|
.TP
|
||||||
\f[B]*\f[R] \f[I]pat\f[R]
|
\f[B]*\f[R] \f[I]pat\f[R]
|
||||||
Some \f[I]pat\f[R]s (zero or more, e.g.\ \f[B]* \[dq]x\[dq]\f[R] matches
|
Any \f[I]pat\f[R]s (zero or more, e.g.\ \f[B]* \[dq]x\[dq]\f[R] matches
|
||||||
\f[B]\[lq]\[lq]\f[R], \f[B]\[rq]x\[rq]\f[R], \f[B]\[lq]xx\[rq]\f[R],
|
\f[B]\[lq]\[lq]\f[R], \f[B]\[rq]x\[rq]\f[R], \f[B]\[lq]xx\[rq]\f[R],
|
||||||
etc.)
|
etc.)
|
||||||
.TP
|
.TP
|
||||||
\f[B]+\f[R] \f[I]pat\f[R]
|
\f[B]+\f[R] \f[I]pat\f[R]
|
||||||
At least one \f[I]pat\f[R]s (e.g.\ \f[B]+ \[dq]x\[dq]\f[R] matches
|
Some \f[I]pat\f[R]s (e.g.\ \f[B]+ \[dq]x\[dq]\f[R] matches
|
||||||
\f[B]\[lq]x\[rq]\f[R], \f[B]\[lq]xx\[rq]\f[R], \f[B]\[lq]xxx\[rq]\f[R],
|
\f[B]\[lq]x\[rq]\f[R], \f[B]\[lq]xx\[rq]\f[R], \f[B]\[lq]xxx\[rq]\f[R],
|
||||||
etc.)
|
etc.)
|
||||||
.TP
|
.TP
|
||||||
@ -246,10 +260,10 @@ Any text (except newlines) up to and including \f[I]pat\f[R]
|
|||||||
.TP
|
.TP
|
||||||
\f[B].. %\f[R] \f[I]skip\f[R] \f[I]pat\f[R]
|
\f[B].. %\f[R] \f[I]skip\f[R] \f[I]pat\f[R]
|
||||||
Any text (except newlines) up to and including \f[I]pat\f[R], skipping
|
Any text (except newlines) up to and including \f[I]pat\f[R], skipping
|
||||||
over instances of \f[I]skip\f[R]
|
over instances of \f[I]skip\f[R] (e.g.\ \f[B]\[aq]\[dq]\[aq]
|
||||||
(e.g.\ \f[B]\[aq]\[dq]\[aq] ..%(\[aq]\[rs]\[aq] .) \[aq]\[dq]\[aq]\f[R]
|
\&..%(\[aq]\[rs]\[aq] .)
|
||||||
opening quote, up to closing quote, skipping over backslash followed by
|
\[aq]\[dq]\[aq]\f[R] opening quote, up to closing quote, skipping over
|
||||||
a single character)
|
backslash followed by a single character)
|
||||||
.TP
|
.TP
|
||||||
\f[B].. =\f[R] \f[I]only\f[R] \f[I]pat\f[R]
|
\f[B].. =\f[R] \f[I]only\f[R] \f[I]pat\f[R]
|
||||||
Any number of repetitions of the pattern \f[I]only\f[R] up to and
|
Any number of repetitions of the pattern \f[I]only\f[R] up to and
|
||||||
@ -257,8 +271,9 @@ including \f[I]pat\f[R] (e.g.\ \f[B]\[dq]f\[dq] ..=abc \[dq]k\[dq]\f[R]
|
|||||||
matches the letter \[lq]f\[rq] followed by some alphabetic characters
|
matches the letter \[lq]f\[rq] followed by some alphabetic characters
|
||||||
and then a \[lq]k\[rq], which would match \[lq]fork\[rq], but not
|
and then a \[lq]k\[rq], which would match \[lq]fork\[rq], but not
|
||||||
\[lq]free kit\[rq]) This is essentially a \[lq]non-greedy\[rq] version
|
\[lq]free kit\[rq]) This is essentially a \[lq]non-greedy\[rq] version
|
||||||
of \f[B]*\f[R], and \f[B].. pat\f[R] can be thought of as the special
|
of \f[B]*\f[R], and \f[B]..
|
||||||
case of \f[B]..=. pat\f[R]
|
pat\f[R] can be thought of as the special case of \f[B]..=.
|
||||||
|
pat\f[R]
|
||||||
.TP
|
.TP
|
||||||
\f[B]<\f[R] \f[I]pat\f[R]
|
\f[B]<\f[R] \f[I]pat\f[R]
|
||||||
Matches at the current position if \f[I]pat\f[R] matches immediately
|
Matches at the current position if \f[I]pat\f[R] matches immediately
|
||||||
@ -295,10 +310,9 @@ See the \f[B]GRAMMAR FILES\f[R] section for more info.
|
|||||||
.TP
|
.TP
|
||||||
\f[B]\[at]\f[R] \f[I]name\f[R] \f[B]=\f[R] \f[I]pat\f[R]
|
\f[B]\[at]\f[R] \f[I]name\f[R] \f[B]=\f[R] \f[I]pat\f[R]
|
||||||
Let \f[I]name\f[R] equal \f[I]pat\f[R] (named capture).
|
Let \f[I]name\f[R] equal \f[I]pat\f[R] (named capture).
|
||||||
Named captures can be used as backreferences like so:
|
Named captures can be used as backreferences like so: \f[B]\[at]foo=word
|
||||||
\f[B]\[at]foo=word \[ga]( foo \[ga])\f[R] (matches
|
\[ga]( foo \[ga])\f[R] (matches \f[B]\[lq]asdf(asdf)\[rq]\f[R] or
|
||||||
\f[B]\[lq]asdf(asdf)\[rq]\f[R] or \f[B]\[lq]baz(baz)\[rq]\f[R], but not
|
\f[B]\[lq]baz(baz)\[rq]\f[R], but not \f[B]\[lq]foo(baz)\[rq]\f[R])
|
||||||
\f[B]\[lq]foo(baz)\[rq]\f[R])
|
|
||||||
.TP
|
.TP
|
||||||
\f[I]pat\f[R] \f[B]=>\f[R] \f[B]\[dq]\f[R]\f[I]replacement\f[R]\f[B]\[dq]\f[R]
|
\f[I]pat\f[R] \f[B]=>\f[R] \f[B]\[dq]\f[R]\f[I]replacement\f[R]\f[B]\[dq]\f[R]
|
||||||
Replace \f[I]pat\f[R] with \f[I]replacement\f[R].
|
Replace \f[I]pat\f[R] with \f[I]replacement\f[R].
|
||||||
@ -308,11 +322,10 @@ references to captured values: \f[B]\[at]0\f[R] (the whole of
|
|||||||
\f[I]pat\f[R]), \f[B]\[at]1\f[R] (the first capture in \f[I]pat\f[R]),
|
\f[I]pat\f[R]), \f[B]\[at]1\f[R] (the first capture in \f[I]pat\f[R]),
|
||||||
\f[B]\[at]\f[R]\f[I]foo\f[R] (the capture named \f[I]foo\f[R] in
|
\f[B]\[at]\f[R]\f[I]foo\f[R] (the capture named \f[I]foo\f[R] in
|
||||||
\f[I]pat\f[R]), etc.
|
\f[I]pat\f[R]), etc.
|
||||||
For example,
|
For example, \f[B]\[at]word _ \[at]rest=(*word % _) =>
|
||||||
\f[B]\[at]word _ \[at]rest=(*word % _) => \[dq]\[at]rest:\[rs]n\[rs]t\[at]1\[dq]\f[R]
|
\[dq]\[at]rest:\[rs]n\[rs]t\[at]1\[dq]\f[R] matches a word followed by
|
||||||
matches a word followed by whitespace, followed by a series of words and
|
whitespace, followed by a series of words and replaces it with the
|
||||||
replaces it with the series of words, a colon, a newline, a tab, and
|
series of words, a colon, a newline, a tab, and then the first word.
|
||||||
then the first word.
|
|
||||||
.TP
|
.TP
|
||||||
\f[I]pat1\f[R] \f[B]\[ti]\f[R] \f[I]pat2\f[R]
|
\f[I]pat1\f[R] \f[B]\[ti]\f[R] \f[I]pat2\f[R]
|
||||||
Matches when \f[I]pat1\f[R] matches and \f[I]pat2\f[R] can be found
|
Matches when \f[I]pat1\f[R] matches and \f[I]pat2\f[R] can be found
|
||||||
@ -383,7 +396,8 @@ Using the \f[I]html\f[R] grammar, find all \f[I]element\f[R]s matching
|
|||||||
the tag \f[I]a\f[R] in the file \f[I]foo.html\f[R]:
|
the tag \f[I]a\f[R] in the file \f[I]foo.html\f[R]:
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
\f[B]bp -g html -p \[aq]element \[ti] (\[ha]\[ha]\[dq]<a \[dq])\[aq] foo.html\f[R]
|
\f[B]bp -g html -p \[aq]element \[ti] (\[ha]\[ha]\[dq]<a \[dq])\[aq]
|
||||||
|
foo.html\f[R]
|
||||||
.RE
|
.RE
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Bruce Hill (\f[I]bruce\[at]bruce-hill.com\f[R]).
|
Bruce Hill (\f[I]bruce\[at]bruce-hill.com\f[R]).
|
||||||
|
4
bp.1.md
4
bp.1.md
@ -202,11 +202,11 @@ by the same indentation that occurs on the current line.
|
|||||||
**"xx"**, **"xxx"**, **"xxxx"**, etc.)
|
**"xx"**, **"xxx"**, **"xxxx"**, etc.)
|
||||||
|
|
||||||
`*` *pat*
|
`*` *pat*
|
||||||
: Some *pat*s (zero or more, e.g. `* "x"` matches **""**, **"x"**, **"xx"**,
|
: Any *pat*s (zero or more, e.g. `* "x"` matches **""**, **"x"**, **"xx"**,
|
||||||
etc.)
|
etc.)
|
||||||
|
|
||||||
`+` *pat*
|
`+` *pat*
|
||||||
: At least one *pat*s (e.g. `+ "x"` matches **"x"**, **"xx"**, **"xxx"**, etc.)
|
: Some *pat*s (e.g. `+ "x"` matches **"x"**, **"xx"**, **"xxx"**, etc.)
|
||||||
|
|
||||||
*repeating-pat* `%` *sep*
|
*repeating-pat* `%` *sep*
|
||||||
: *repeating-pat* (see the examples above) separated by *sep* (e.g. `*word %
|
: *repeating-pat* (see the examples above) separated by *sep* (e.g. `*word %
|
||||||
|
Loading…
Reference in New Issue
Block a user