I need to backtrace a string for a particular value to parse out. Is there any way to get the required output by using regular expressions.
;2N9XsPQQ;PARAMETER_STRING=
Required o/p : 2N9XsPQQ
Thanks in Advance
I need to backtrace a string for a particular value to parse out. Is there any way to get the required output by using regular expressions.
;2N9XsPQQ;PARAMETER_STRING=
Required o/p : 2N9XsPQQ
Thanks in Advance
I think a simple:
NSString *pattern = @"(?<=;).*(?=;)"; //or equivalent
will do the work for you.
Online demo
UPDATE
On Netezza SQL the lookbehind is not available so try one of the alternative solutions:
# Tested on Postgresql (no Netezza, postgres derived db, available atm)
SELECT regexp_matches('123abc;2N9XsPQQ;PARAMETER_STRING=',';(.*);');
# OR
SELECT regexp_replace('123abc;2N9XsPQQ;PARAMETER_STRING=','.*;(.*);.*','\1');