Skip to content
Advertisement

SAP HANA | Get string between two strings

I have below data in my table T –

    ROW      Col1

      1       utm_source:|utm_medium:kiosk|device:d|expires:Sun, 02 Jun 
              2019 13:27:28 GMT|IP:10.YYY.YY.YY|
      2       IP:10.XXX.XX.XX|storeid:TL04K2|
      3       IP:10.YY.YX.XZ|

I need to get IP from this column which will be identified by string start as ‘IP:’ and string end as ‘|’

Is it possible to get this with substring_regexp in hana?

Advertisement

Answer

Try using :

select substr_regexpr('IP:+(?<=IP:)(.*?)(?=|)' in your column ) from dummy;
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement