Replacing label values by regex not working with params

Hey there! I’ve setup some charts that monitor traffic to different endpoint and I’ve set my legend to look something like:

{{controller}}/{{action}} - method: {{method}}, code: {{code}} e.g.
foo/bar - method: GET, code: 200

However some of the methods are from SignalR which don’t have controllers and actions and they come out as

/ - method: GET, code: 200

I want for the instances which start with a forward slash to use another pattern like

method: {{method}}, code: {{code}} and then maybe add some other param so the label is more descriptive

However when I do that in transform it does not work it, just types that exact string, so is there a fix for that.