08 Nov 2023 12:23 PM - last edited on 08 Nov 2023 12:44 PM by Ana_Kuzmenchuk
Calling all regex Gurus!
I'm trying to target the RxVisitor Value as a request attribute, what would be the best way to capture this? my current string 'rxVisitor=([^\-]*+)' captures data even after the ';' where the targeted value ends.
Many thanks in advance 🙂
Solved! Go to Solution.
08 Nov 2023 01:09 PM
It should be enough to add the semi-colon in that list of characters that shouldn't be matched:
rxVisitor=([^\-;]*+)
08 Nov 2023 01:56 PM
Thanks for your replies 🙂 I did put in a 'between filter' from the start of the string to the end of the string but I also want to take into account of the duplicate values. Trying to formulate as to what that would look like as well from a cookie perspective.
14 Nov 2023 01:38 PM
Hey Regex Gurus,
I need some more assistance. so that RxVisitor can occur twice in the cookie payload, but I need to be able to target if 1 or 2 are present. So I was wondering, Could you assist me in building a Regex that looks for the RxVisitor as you did but for the first grouping, then another one that will look at the second grouping.
Reason being is that we ran into a roadblock with the counting of cookies etc and it cant actually count the targeted segments in the cookie.
So an example cookie payload would look like this:
p_Verizonwt=1; DMFDQ_1jfosdjd768%40gov.Org=1; s_cc=true; sscook=11; rxVisitor=1111; UserIDValue=haksfuoth57639829fjasfdk37895o3k3rsdf; UserName=Santa.Clause; ; rxVisitor=2222; HIHTOKEN=abcdefg; GG20=1;
I'm interested in grating two RAs - the first RA will target and extract the cookie value of rxVisitor group 1. Which should result in a RA Key:Value pair of:
rxVisitor Group 1 = 1111
And then make another RA that looks at the same rxVisitor segment and extracts the data out but on a group 2 qualifier. Which should result in a RA Key:Value pair of:
rxVisitor Group 2 = 2222
Granted if there is no second qualifier on that cookie payload that is fine, I would then expect that the RA would not qualify. The biggest thing is that we create an RA when a second grouping of a cookie is found.
Lastly the reason why we need to create two RAs is because the RA will only allow one capture group.
14 Nov 2023 05:06 PM - edited 14 Nov 2023 05:08 PM
I got the Groupings built 🙂
rxVisitor=(?=1)[^\-;]*+
Basically change the ?=1 to the number of the groups you want to target. 1 gives you the first qualifier, 2 is the second and so on.
So now I have two RAs, one looking at the first qualifier, then the second. So I expect the second to always be empty, if it has a value then we have issues. this can also be added at the session level for the apps.