I have a string and I need to match a pattern and discard the rest of the string after the first occurrence of a delimiter after the patter matched
sample string :
_fw_xx_app_id=xxxxx&adobe_id=59742375247590810332565440942222920249&krux_user=yyyyyyy&User_Agent=zzzzzz&_fw_did_idfa=aaaaaaa&_fw_dpr=2.00&_fw_ae=nonauthenticated&_fwu%3A386123%3Atqxqle5of=1&_fwu%3A386123%3Atshc3wdb8=1
I want to extract only the value that is after key '_fw_ae=' until the first occurrence of &
I tried this
regexp_substr(all_request_kv,'_fw_ae=(.+?)&|$',1,1,'e')
but this is bringing everything after the _fw_ae= like below
_fw_ae=nonauthenticated&_fwu%3A386123%3Atqxqle5of=1&_fwu%3A386123%3Atshc3wdb8=1 where as i only want nonauthenticated in this example
Instead of a non greedy quantifier, you could use a negated character class [^&]
matching not an &
inside a capturing group:
_fw_ae=([^&]+)