Full string match #737
|
In java, i could do |
Replies: 2 comments 2 replies
|
From the docs:
So in your case, you would want: use regex::Regex;
fn main() {
let matched = Regex::new(r"^regexStr$").unwrap().is_match("string");
println!("{:?}", matched);
} |
|
I had this same problem with one of my projects (JDK vs. Rust regex match logic difference) The regex was part of JSON serialized interface, and also part of the API was a checksum calculated over the Regex Pattern. So fixing this difference in semantics was little bit tricky. The code is here, and it's licensed as Apache License, version 2.0 or MIT, at your option: Example how this is used: |
From the docs:
So in your case, you would want: