Functions

REPLACEREGEX

Replaces one string with another using regular expressions.

Syntax

string REPLACEREGEX(string value, string expression, string newValue)
string REPLACEREGEX(string value, string expression, string newValue, bool ignoreCase)

Input

Object Data Type Description
value String The original string to look in.
expression String The regular expression to use.
newValue String The new string to put in place.
ignoreCase Boolean A boolean indicating that the case of the item should be ignored.

Example

There are certain filename characters that are not valid for filenames in SharePoint ~ " # % & * : < > ? / \ { | }.

If you find that your file names have any of these characters then you can use the REPLACEREGEX function to replace these with something that is valid. An expression you could use:

REPLACEREGEX(FileName, "[~\"#%&*:<>?/\\{|}]", "_")

This would replace any of these character with an underscore.