We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d4d87e commit 60a6967Copy full SHA for 60a6967
src/pattern.rs
@@ -18,7 +18,7 @@ impl Pattern {
18
.map_err(|source| token.error(CompileErrorKind::ArgumentPatternRegex { source }))?;
19
20
Ok(Self(
21
- format!("^({})$", literal.cooked)
+ format!("^(?:{})$", literal.cooked)
22
.parse::<Regex>()
23
.map_err(|source| token.error(CompileErrorKind::ArgumentPatternRegex { source }))?,
24
))
@@ -27,7 +27,7 @@ impl Pattern {
27
28
impl Display for Pattern {
29
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
30
- write!(f, "{}", &self.0.as_str()[2..self.0.as_str().len() - 2])
+ write!(f, "{}", &self.0.as_str()[4..self.0.as_str().len() - 2])
31
}
32
33
0 commit comments