s

Input Stack:
replacement: String
searchPattern: String
TimeSeriesExpr
Output Stack:
StyleExpr
 
 

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:

BeforeAfter
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
^nccp-(.*)$,$1,:s
BeforeAfter
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
^nccp-(?.*)$,$stack,:s
BeforeAfter
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
nccp-,_,:s
BeforeAfter
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend
name,sps,:eq,
(,nf.cluster,),:by,
$nf.cluster,:legend,
([a-z]),_$1,:s