Skip to content

Commit

Permalink
resolve issue: \Zx where x is any escape sequence
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Aralihalli <[email protected]>
  • Loading branch information
SurajAralihalli committed Oct 30, 2024
1 parent ecad092 commit b104612
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,10 @@ The following regular expression patterns are not yet supported on the GPU and w
- Line anchors `^` and `$` are not supported in some contexts, such as when combined with a choice (`^|a` or `$|a`).
- String anchor `\Z` is not supported by `regexp_replace`, and in some rare contexts.
- String anchor `\z` is not supported.
- Patterns containing an end of line or string anchor immediately next to a newline or repetition that produces zero
- Patterns containing an end-of-line or string anchor immediately next to a newline or repetition that produces zero
or more results
- Patterns containing end-of-line anchors like `$` or `\Z` immediately followed by
escape sequences (e.g., `\w`, `\b`) are not supported.
- Line anchor `$` and string anchors `\Z` are not supported in patterns containing `\W` or `\D`
- Line and string anchors are not supported by `string_split` and `str_to_map`
- Lazy quantifiers within a choice block such as `(2|\u2029??)+`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,10 @@ class CudfRegexTranspiler(mode: RegexMode) {
// however, cudf doesn't support negative look ahead
throw new RegexUnsupportedException("Regex sequence $\\z is not supported",
part.position)
case RegexEscaped(a) if "bB".contains(a) =>
case RegexEscaped(a) if "bBsSdDwWaAf".contains(a) =>
throw new RegexUnsupportedException(
"Regex sequences with \\b or \\B not supported around $", part.position)
s"Regex sequences with \\$a are not supported around end-of-line markers " +
"like $ or \\Z at position", part.position)
case _ =>
r.append(rewrite(part, replacement, last, flags))
}
Expand Down

0 comments on commit b104612

Please sign in to comment.