replace

Same function as replace() but with regexes. Returns a String, List or Dict, of which all occurrences (in Values - not Keys) of str_search in $data have been replaced by str_replace.
sub($data , str_search , str_replace ) : String | List | Dict
$data.sub( str_search , str_replace ) : String | List | Dict
Parameters
$data String | List | Dict
str_search String (Python Regex)

The regex to look for.

str_replace String

Replacement value. Back references, such as \6, are replaced by the substring corresponding to group 6 in the str_search pattern.

See also
Examples

How to replace in String with Regex (sub)