-
Notifications
You must be signed in to change notification settings - Fork 471
Closed
Labels
Description
Both the docs of regex 1.0.5
and regex-syntax 0.6.2
suggests that [[:blank:]]
is equivalent to [ \t]
, but it is actually wrong as shown in the test program below:
extern crate regex; // 1.0.5
fn main() {
let r = regex::Regex::new("[[:blank:]]").unwrap();
assert!(!r.is_match("\u{17}")); // unexpectedly panicked
}
I believe the error is due to
regex/regex-syntax/src/hir/translate.rs
Lines 1042 to 1045 in 488fe56
Blank => { | |
const X: T = &[(' ', '\t')]; | |
X | |
} |
line 1043 should read
const X: T = &[('\t', '\t'), (' ', ' ')];
RReverser