cancel
Showing results for 
Search instead for 
Did you mean: 

Split string using Regular Expression

Former Member
0 Kudos

Hi,

I want to split a string like below

OTHER!@!1000-01-01!@!N!@!TEST EXPLANATION' -- KEYWORD!@!ACCOUNT!@!MANSYS!@!EXCLUDEEXPLANATION

I want to split the string where it has !@! using regular expression.

Please help me.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185132
Active Contributor
0 Kudos

Hi,

You do not need regex for this.

Refer this StackOverflow page, they've addressed the same issue: http://stackoverflow.com/questions/27709088/hana-split-string

In that page they've used comma "," as the delimiter, you can use "!@!" instead.

By the way, if you are getting this data from elsewhere, like from a Java program or Python script etc, think about doing the splits there. Most languages have some sort of String.split() function that will be easier than creating a procedure in HANA.

Regards,

Suhas

Former Member
0 Kudos

Thanks for the update.

Please share an example of using regex in sap hana.

I will try out some thing on top of that.

former_member185132
Active Contributor
0 Kudos

Splitting is not possible using the regex functions provided in HANA. The regex functions in SAP HANA are available in the documentation.

Regexes won't help you do what you are intending, but if you want examples of regex you can refer the documentation on this functionality.