Search notes:

Vim ex command: :substitute

`[range]:s/{regexp}/{string}/[flags] [count]`
Replace stings that match the regexp with string.

Replace a string with an expression

Starting the subsitute string with an \= causes the replace string to be evaluated as an expression.
The following command replaces an URI-percent-encoded (aka URL encoding) octet with its corresponding ASCII value:
s/%\(..\)/\=nr2char(str2nr(submatch(1), 16))/g

See also

The substitute() function.

Index