Skip to Content

REPLACE_REGEXPR function in script

Hello Experts,

Below is the logic for regexp_replace from oracle 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

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2016 at 08:55 AM

    Hi Krish,

    Number can consist of numbers and spaces plus the following characters: + - ( ) / \ for this condition below is the reg expression.

    if (/^[\d \+\-\(\)\/\\]{6,24}$/.test(sNumber)) {

    return true;

    }

    return false;

    }

    Hope this is helpful.

    Regards,

    Malthesha Sungar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 14, 2016 at 10:50 PM

    Please don't cross post your questions!

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Lars..

      Even I don't like to post the same query at multiple Place.

      Initially I posted the query in Hana Dev. Center, but after sometime... it is not showing in Hana Devloper Center - Content, dont know why it is showing to you.

      So that was the reason I have posted it again in Hana In-memory Computing.

      Regards,

      Kris

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.