alamb commented on PR #21379:
URL: https://github.com/apache/datafusion/pull/21379#issuecomment-4193416682

   I don't think this rewrite is correct in all cases
   
   Here are some .slt test that pass on main but not this PR:
   
   ```sql
   
   # If the overall pattern matches but capture group 1 does not participate,
   # regexp_replace(..., '\1') should substitute the empty string, not keep
   # the original input.
   query B
   SELECT regexp_replace('bzzz', '^(a)?b.*$', '\1') = '';
   ----
   true
   
   # Stripping trailing .*$ must not change match semantics for inputs with
   # newlines when the original pattern does not use the 's' flag.
   query B
   SELECT regexp_replace(concat('http://x/', chr(10), 'rest'), 
'^https?://([^/]+)/.*$', '\1')
          = concat('http://x/', chr(10), 'rest');
   ----
   true
   ```
   
   (they return false on this branch)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to