The REGEXREPLACE( ) function uses a regular expression to find matching patterns in data, and replaces any matching values with a new string.
Read moreWhat is $1 in regex replace?
The $ number language element includes the last substring matched by the number capturing group in the replacement string, where number is the index of the capturing group. For example, the replacement pattern $1 indicates that the matched substring is to be replaced by the first captured group .
Read moreWhat is regex Backreference?
A backreference in a regular expression identifies a previously matched group and looks for exactly the same text again . A simple example of the use of backreferences is when you wish to look for adjacent, repeated words in some text. The first part of the match could use a pattern that extracts a single word.
Read moreHow do you replace in regex?
Find and replace text using regular expressions
Read more