Instead of doing multiple inline `group.pid.gsub` can you declare a `escaped_pid = group.pid.gsub`; Then we know what the purpose was.