Update regex-syntax to support new word boundry assertions

From the regex v1.10.0 release notes [1]:

    This is a new minor release of regex that adds support for start
    and end word boundary assertions. [...]

    The new word boundary assertions are:

        • \< or \b{start}: a Unicode start-of-word boundary (\W|\A
          on the left, \w on the right).
        • \> or \b{end}: a Unicode end-of-word boundary (\w on the
          left, \W|\z on the right)).
        • \b{start-half}: half of a Unicode start-of-word boundary
          (\W|\A on the left).
        • \b{end-half}: half of a Unicode end-of-word boundary
          (\W|\z on the right).

[1]: https://github.com/rust-lang/regex/blob/master/CHANGELOG.md#1100-2023-10-09
This commit is contained in:
Peter Gerber 2023-12-02 13:04:39 +00:00
parent ee8376075d
commit af1b58fa39
No known key found for this signature in database
GPG Key ID: 359A9D773A6329E6
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,7 @@ clippy_utils = { path = "../clippy_utils" }
declare_clippy_lint = { path = "../declare_clippy_lint" } declare_clippy_lint = { path = "../declare_clippy_lint" }
itertools = "0.11" itertools = "0.11"
quine-mc_cluskey = "0.2" quine-mc_cluskey = "0.2"
regex-syntax = "0.7" regex-syntax = "0.8"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true }
tempfile = { version = "3.3.0", optional = true } tempfile = { version = "3.3.0", optional = true }

View File

@ -112,6 +112,10 @@ fn trivial_regex() {
// #6005: unicode classes in bytes::Regex // #6005: unicode classes in bytes::Regex
let a_byte_of_unicode = BRegex::new(r"\p{C}"); let a_byte_of_unicode = BRegex::new(r"\p{C}");
// start and end word boundry, introduced in regex 0.10
let _ = BRegex::new(r"\<word\>");
let _ = BRegex::new(r"\b{start}word\b{end}");
} }
fn main() { fn main() {