Skip to content

Commit

Permalink
Update docs&bump version to v0.5.5-rust and v0.3.13-python
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-wanna-M committed Oct 25, 2024
1 parent a3a1e0a commit 7e78030
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = [
license = "MIT OR Apache-2.0"
name = "kbnf"
repository = "https://github.com/Dan-Wanna-M/kbnf"
version = "0.5.4"
version = "0.5.5"
[lib]
name = "kbnf"
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python-source = "python"
features = ["python"]
[project]
name = "kbnf"
version = "0.3.12"
version = "0.3.13"
dependencies = ["numpy"]
requires-python = ">=3.7"
classifiers = [
Expand Down
16 changes: 15 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ a nonempty sequence of "A"s and "B"s followed by exactly one "C".*)
## Regular expression
A UTF-8 string enclosed in `#""` or `#e""` is a regular expression. The escaped characters supported is the same as [Terminal](##terminal).
There are three types of regular expressions:
- A UTF-8 string enclosed in `#""` or `#''` is a regular expression. The escaped characters supported is the same as [Terminal](##terminal).
```ebnf
start ::= #".*A";
Expand All @@ -372,6 +374,8 @@ start ::= #".+" "A";
*)
```
- A UTF-8 string enclosed in `#e""` or `#e''` is a regular expression. The escaped characters supported is the same as [Terminal](##terminal).
```ebnf
start ::= #e".*AA";
(*
Expand All @@ -382,6 +386,16 @@ In other words, two consecutive A will not appear in the middle of the output.
*)
```
- A UTF-8 string enclosed in `#ex""` or `#ex''` is a complement of a regular expression. The escaped characters supported is the same as [Terminal](##terminal).
```ebnf
start ::= #ex"a|b|c" "A";
(*
The engine will constrain the output to be anything that does not contain "a", "b", or "c" followed by "A".
*)
```
The Rust regex crate is used to support regular expressions,
which means [the syntax supported](https://docs.rs/regex/latest/regex/index.html#syntax) might differ from other regex engines.
Notably, the regex crate does not support arbitrary lookarounds. In exchange, linear time matching is guaranteed.
Expand Down

0 comments on commit 7e78030

Please sign in to comment.