confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
128 stars 1.04k forks source link

RegExp scalar function do not escape special characters #9834

Open gadget2022 opened 1 year ago

gadget2022 commented 1 year ago

Unable to escape characters with usual RegExp methods like using backslash, backslash with parentheses, backslash with double quotes, backslash with single quotes or \Q\E.

Tested with \ and * special characters

To Reproduce

  1. ksqlDB version 0.28.2
  2. Running streams out of any sample data into ksqlDB CLI

create stream TEST as select REGEXP_EXTRACT('\u0000','\u0000 1111-222, 1112-223') as backslash_escaped FROM CONTACTS emit changes; Result: 'u0000'

create stream TEST_2 as select REGEXP_EXTRACT('(backslash here, hidden by editor)\u0000','\u0000 1111-222, 1112-223') as backslash_escaped FROM CONTACTS emit changes; Result: 'u0000'

Expected behavior create stream TEST as select REGEXP_EXTRACT('(backslash here, hidden by editor)\u0000','\u0000 1111-222, 1112-223') as backslash_escaped FROM CONTACTS emit changes; Result: '\u0000'

Or need to improve documentation? Thank you

suhas-satish commented 1 year ago

This is just a documentation enhancement request

gadget2022 commented 1 year ago

Hello. Could someone improve documentation on this issue? Thank you

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

+1

gadget2022 commented 1 year ago

Thank you for improving docs. Now everybody in our team understand how to work with regular expressions in ksqlDB

gadget2022 commented 1 year ago

Close issue