s
Input Stack:replacement: String | searchPattern: String | TimeSeriesExpr |
|
⇨ |
Output Stack: |
Perform a search and replace on the legend strings. This command is similar
to the global search and replace (s/regexp/replace/g
) operation from tools
like vim or sed.
The replacement string can use variables to refer to the capture groups of the
input expression. The syntax is that same as for legends.
Since: 1.6
Examples:
Before | After |
| |
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
| name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
^nccp-(.*)$,$1,:s
|
Before | After |
| |
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
| name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
^nccp-(?.*)$,$stack,:s
|
Before | After |
| |
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
| name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
nccp-,_,:s
|
Before | After |
| |
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
| name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
([a-z]),_$1,:s
|