RegexpReplace
Last updated
Was this helpful?
Last updated
Was this helpful?
The RegexpReplace function searches a string for a pattern and replaces all matches with the replacement string. If no matches are found, the original string is returned.
Function arguments:
string (required): The string to search.
pattern (required): The pattern to extract with.
replacement (required): String to replace the sought pattern.
πWhen the regular expression you want to use contains a slash, quotation or other special character, you will need to use a backslash (\) to escape the special character.Regexp
can vary based on the databases. Check the documentation of your database to find the correct syntax.
Example 1:
Replaces every space between digits and digits preceding "mm" with a dash to indicate the range of camera lenses.
Example 2:
Transforms a phone number to (xxx) xxx-xxxx formatting.
Example 3:
Replaces every character before the comma with the city in proper form.
Example 4:
Removes all punctuation marks in a string.
Example 5:
Replaces the slash with "&".