denoland / denoland/rust-urlpattern
Rust regex doesn't respect EcmaScript regex invalid pattern
- Dominant language
- Rust
- Stars
- 76
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
The following test shows that this invalid regex input is being successfully parsed by Rust's Regex crate, but according to URLPattern spec it should fail.
```
#[test]
fn test_test() {
let input = "((?R))"; // invalid in EcmaScript regex
let _ = ::parse(
UrlPatternInit {
protocol: Some(input.to_string()),
..Default::default()
},
Default::default(),
)
.unwrap();
}
```
This currently passes because the following fragment passes:
```
let input = "((?R))";
let regexp = regex::Regex::new(input);
regexp.unwrap();
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.