Full string match #737
-
In java, i could do |
Beta Was this translation helpful? Give feedback.
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);
} |
Beta Was this translation helpful? Give feedback.
-
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: |
Beta Was this translation helpful? Give feedback.
From the docs:
So in your case, you would want: