-
Notifications
You must be signed in to change notification settings - Fork 483
Closed
Description
Python re
module supports (?!...)
syntax, see https://docs.python.org/2/library/re.html#regular-expression-syntax
The code below compiles but paniced at runtime:
extern crate regex;
fn main() {
let re = regex::Regex::new(r"Isaac (?!Asimov)").unwrap();
println!("{}", re.is_match("Isaac "));
println!("{}", re.is_match("Isaac Asimov"));
}
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value:
Syntax(Error { pos: 8, surround: "ac (?!Asim", kind: UnrecognizedFlag('!') })',
../src/libcore/result.rs:738
The pattern works fine in Python:
import re
pt = re.compile(r"Isaac (?!Asimov)")
pt.match("Isaac ")
pt.match("Isaac Asimov")
obskyr, mateja176, tadman, lwilli, bastilimbach and 10 more
Metadata
Metadata
Assignees
Labels
No labels