Skip to content

Commit 12f2ca9

Browse files
committed
Update README
1 parent d2f5284 commit 12f2ca9

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ backed by a user provided regular expression engine. Support for using the
1111
## Documentation
1212

1313
This crate's public API is documented in [docs.rs](https://docs.rs/structex).
14+
See the [Structex](https://docs.rs/structex/latest/structex/struct.Structex.html)
15+
struct for details of the primary public API.
16+
17+
[This blog post](https://www.sminez.dev/match-it-again-sam/) provides an overview
18+
of how structural expressions work along with some extended examples of how to
19+
make use of this crate.
1420

1521
## Usage
1622

@@ -89,6 +95,10 @@ full input and then accept a chain of one or more of the following operators:
8995
- `v/$re/` "inverse guard" the rest of the following chain on `$re` _not_
9096
matching dot.
9197

98+
> Note that the use of '/' as the delimiter here is by convention: any character
99+
> other than ';' may be used. To insert your chosen delimiter inside of the
100+
argument of an operator or action, escape it with a backslash.
101+
92102
[^narrow]: The `n` narrowing operator is a new edition to the syntax added by
93103
this crate. In Pike's original system this narrowing was possible via "address"
94104
expressions that set dot using a rich syntax that made use of both regular
@@ -183,13 +193,14 @@ when we match the second. Running again over our input we will get both
183193
the matches themselves _and_ their associated tag: `("This", 'B')`,
184194
`("Bob", 'A')`, `("Alice", 'A')` and `("friend", 'A')`.
185195

186-
Actions can also have an associated "argument" enclosed in slashes. This
187-
is useful for defining tags that control the type of action to be taken
188-
(for example `p` for printing) and then an additional argument that can
189-
be used alongside the match in order to handle the action (such as a
190-
template string). See the [templated_printing][7] example in the repo for
191-
a demonstration of how this can be implemented for a more complicated
192-
expression that uses multiple different template strings.
196+
Actions can also have an associated "argument" enclosed in the delimiter
197+
of your choice. This is useful for defining tags that control the type of
198+
action to be taken (for example `p` for printing) and then an additional
199+
argument that can be used alongside the match in order to handle the
200+
action (such as a template string). See the [templated_printing][7]
201+
example in the repo for a demonstration of how this can be implemented
202+
for a more complicated expression that uses multiple different template
203+
strings.
193204

194205

195206
[0]: https://docs.rs/regex/latest/regex/index.html

0 commit comments

Comments
 (0)