I'm trying to extract the text following deviceSerialNumber= that occurs until either a & or the end of the string. Data looks like
someddata&=somedataagain&deviceSerialNumber=device12345&anotherField=moreData someddata&=somedataagain&deviceSerialNumber=deviceabcd
I've tried this
REGEXP_SUBSTR(session_tags || '&', 'deviceSerialNumber(.*)&') from table
but, this returns all of the text until the final & (which is the end of the string, since I'm appending a & for pattern matching purposes). How do I have to modify this regular expression to extract only the text until the first &?