Link to home
Start Free TrialLog in
Avatar of Cesar Aracena
Cesar AracenaFlag for Argentina

asked on

What would be the regex to match everything from the 2nd occurrence?

I know this must be simple but I just can't find it.

I have the following string:

mysite.com/xx/xxxxx/xxxxxx/?var1=val1?var2=val2?var3=val3

Open in new window

Now, I know it's bad formatted and that is exactly why I want to delete everything from the second question mark until the end so I'm left with only one variable. Or change the rest of the question marks for equal signs.

Thanks in advance!
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try
(\?(?<=[^\/]\?).*)

Open in new window

Regards
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial