Replaces part of a string based on the supplied regex.
Finds parts of a value using a search pattern and swaps them for something else. This is the flexible version of a find-and-replace: instead of matching one exact phrase, you describe what to look for with a pattern, so you can match things like “any run of spaces”, “anything that is not a digit”, or “a word followed by a number”. Use it to clean up or reformat text in ways a simple search cannot, such as collapsing repeated spaces or stripping out unwanted characters.