Copy link to clipboard
Copied
Hello,
I have the following URL, http://acme.com/jdoe?CID=kno00000000123:561342
and I need to pull the "jdoe" and the CID values ("kno00000000123:561342") separately.
I can pull the "jdoe" part with this expression: ^(.+) but I can't figure out how to combine it to also include the "kno00000000123:561342" portion.
I've tried this, ^(.+)/^CID=(.+), but it doesn't work.
Can someone shed some light?
TIA
Copy link to clipboard
Copied
List functions might be easier.
Copy link to clipboard
Copied
I need RegEx since this is an ISAPI filter on IIS
Copy link to clipboard
Copied
Using ^http://acme.com/([^/]+)\?CID=(.*)$ as your pattern should work for matching what you need (assuming there are no other pattern requirements beyond what you're giving us with your sample URL, like the CID not necessarily being the first param, there maybe being other params, etc). If you use the "returnsubexpressions" switch on reFind() you can then use mid() to pull out the specific values.
--
Adam
Copy link to clipboard
Copied
I'm a little rusty on my Regular expressions, but I think you meant to use a [^?] after the "acme.com/" since I would expect that you are trying to retrieve everything until you hit the "?"
e.g.:
^http://acme.com/([^?]+)\?CID=(.*)$
Balance - you said something about using the RegEx for rewrites in IIS. will you have access to CF or are you using the regular expresions inside of a IIS filter?
Copy link to clipboard
Copied
Good spot: you're dead right about the correction to my regex. I was not paying attention to what I was doing.
--
Adam