Add regex extractor

This commit is contained in:
2026-03-21 09:27:12 -07:00
parent ed169b3ab4
commit b6cb5870b4
10 changed files with 209 additions and 6 deletions

View File

@@ -122,6 +122,14 @@ mod tests {
GroupSegment::Literal(s.into())
}
#[test]
fn regex() {
assert_eq!(
parse("{$.split(/)[-1].regex((.*).pub \\((.*)\\).pdf)[0]}").unwrap(),
vec![(0, path("$.split(/)[-1].regex((.*).pub \\((.*)\\).pdf)[0]"))]
);
}
#[test]
fn single_path() {
assert_eq!(parse("{$.foo}").unwrap(), vec![(0, path("$.foo"))]);