I'm about to write a regex to extract substrings. the string is:
ASP.NET_SessionId=frffcjcarie4dhxouz5yklwu;+BIGipServercapitaliq-ssl=3617221783.36895.0000;+ObSSOCookie=wkyQfn2Cyx2%2f7kSj4zBB886WaLs92Ord9FSf64c%2byHFOBwgEP4f3UmorDj051suQwRXAKEwBtYVKRYJuUGh2YNZtAj2%2bNp8asLIT9xQPqVktEAzkl3jNIv8MyWFsoFPDtm%2fTm1FeaCP%2bGTk9Oa%2fCNA0Hmy847qK2qo7%2bbziV%2bjeClbkGjAX3pgcPzfs%2bQp7p9BSjP1xJqUaUKwJ2%2flIgzZL5Ma%2bnJK8j%2b732ixNyIDNDGo7uIF%2b;+machineIdCookie=866873600;+userLoggedIn=jga;sdgjefdfdfs
I want to extract a substring beginning with ObSSOCookie=....;
and ending just before the userLoggedIn
.
I set my regex pattern
pattern = "ObSSOCookie=.*;"
But it continues to extract until the last semicolon (which includes the +machineIdCookie=866873600
), rather than the first semicolon, which is what I want.
Is there a way to just extract up to the first semicolon? And I can't just use split
by ";" cause this regex is actually to be used in a Logstash
configuration file and there's no way to use python-style coding there...