String Replace with Regular Expressions Example
The following example demonstrates the use of the string replace viper with regular expressions. The strings being replaced must start with an 'r' or 'm' character, followed by the string sequence "ai" and this sequence must be followed by at least one word character. All matching strings will be replaced with an '*' character.
Smartsite SXML | Copy Code |
---|---|
{string.replace('The rain in Spain falls mainly in the plain','(r|m)ai(\w+)', '*', UseRegExp)} |
Example Result | Copy Code |
---|---|
The * in Spain falls * in the plain |