Ticket #1251 (closed defect: worksforme)

Opened 15 months ago

Last modified 15 months ago

Regsuball doesn't replace all occurrences

Reported by: tmotyl Owned by:
Priority: normal Milestone:
Component: varnishd Version: 2.1.5
Severity: normal Keywords:
Cc:

Description

It seems that regsuball is not replacing all occurances of a regular expression. I have code like this in my ACL

set req.url = regsuball(req.url, "(\?|&)(utm_[a-zA-Z]+)=[^&]+&?", "\1");

for url's like

/uk/sale.html?utm_medium=game&utm_source=ad+network&utm_campaign=post+holiday+sale&utm_content=320x50

Varnish returns

/uk/sale.html?utm_source=ad+network&utm_content=320x50

I also tried

set req.url = regsuball(req.url, "(\?|&)(utm_source|utm_medium|utm_content|utm_campaign)=[^&]+&?", "\1");

but the result is the same. I'm using Varnish 2.1.5 on ubuntu.

Change History

comment:1 Changed 15 months ago by tmotyl

It's not a bug - regex is wrong, should be (\?|&)(utm_[a-zA-Z]+)=[^&]+ instead

comment:2 Changed 15 months ago by martin

  • Status changed from new to closed
  • Resolution set to worksforme

Closing as submitter figured it out.

Regards, Martin Blix Grydeland

Note: See TracTickets for help on using tickets.