Skip to Content

REPLACE_REGEXPR function in Hana

Hello Experts,

Below is the logic for regexp_replace from source DB.

Can you please help how to achieve this in Hana Scipt.

regexp_replace(field1,'^[^|]*\|([^|]*).*$','\1') as channel_1,

regexp_replace(field1,'^([^|]*\|){2}([^|]*).*$','\2') as num_channel_1,

sample data format for field1 as below

123123|444|555|6666|77|88

Thanks,

Kris

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jan 14, 2016 at 03:12 PM

    Hi Kris

    I think exact function like regexp_replace is not available in HANA, you might want to use "REPLACE" , "SUBSTRING" and concat them to achieve the same.


    Can you please tell me what out is your intended out put for 123123|444|555|6666|77|88 ?



    Cheers

    Anindya

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.