Ticket #1251 (closed defect: worksforme)

Opened 3 years ago

Last modified 3 years ago

Regsuball doesn't replace all occurrences

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


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


Varnish returns


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 3 years ago by tmotyl

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

comment:2 Changed 3 years 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.