-3

I have a query string I'm trying to remove a query string parameter. What I currently have is

date=(.*)&

But this will remove anything to the last &. I only want to remove to the first occurance of the &.

So this is how it should work:

date=5%2F13%2F16&tab=1&a=b = tab=1&a=b

But mine is doing this:

date=5%2F13%2F16&tab=1&a=b = a=b

I think I probably need something around the & but I read the regex stuff and I just get more confused.

Leeish
  • 5,203
  • 2
  • 17
  • 45

1 Answers1

0

Make it lazy, use:

date=(.*?)&
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142