3 unstable releases

0.2.0 Aug 14, 2022
0.1.1 Aug 14, 2022
0.1.0 May 20, 2020

#116 in Parser tooling

Download history 108/week @ 2022-11-29 155/week @ 2022-12-06 97/week @ 2022-12-13 103/week @ 2022-12-20 89/week @ 2022-12-27 223/week @ 2023-01-03 153/week @ 2023-01-10 201/week @ 2023-01-17 241/week @ 2023-01-24 190/week @ 2023-01-31 176/week @ 2023-02-07 136/week @ 2023-02-14 145/week @ 2023-02-21 158/week @ 2023-02-28 119/week @ 2023-03-07 115/week @ 2023-03-14

563 downloads per month
Used in 2 crates

MIT/Apache

12KB
102 lines

regex-lexer

github crates.io docs.rs build status

A regex-based lexer (tokenizer) in Rust.

Basic Usage

enum Tok {
    Num,
    // ...
}

let lexer = regex_lexer::LexerBuilder::new()
  .token(r"[0-9]+", Tok::Num)
  .ignore(r"\s+") // skip whitespace
  // ...
  .build();
  
let tokens = lexer.tokens(/* source */);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusing in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.9–1.3MB
~37K SLoC