Hello everyone,
What is the regular expression I should use in the Workflow token dialog if I want to remove a character (in this case, a single quote) from anywhere in a string?
Thanks,
Julie
Hello everyone,
What is the regular expression I should use in the Workflow token dialog if I want to remove a character (in this case, a single quote) from anywhere in a string?
Thanks,
Julie
If you're doing it with pattern matching within the token syntax, that's expected behavior as it will only return the first match.
You can use the Pattern Matching activity to create a new token. In this activity you can specify whether you want just the first match or all of them.
An alternative would be to use the Token Calculator activity and its Replace function to replace the single quote to with the empty string.
You can use the [^ ] to exclude characters. ([ ] is used for specifying characters in a range, like [a-c]. [^a-c] is characters not in the specified range, or "anything but a-c"). So, something like [^']+ should do it.
Thanks, although that only returns characters before a quote. So if I have a string like D'Anna, it only returns D. I just want it to strip out a character regardless of where it is in the string.
Asking more broadly, is there a simple way in workflow just to strip out a character? I don't have to use regular expressions. It doesn't look like any of the functions in the token dialog would do it, unless I am missing something.
If you're doing it with pattern matching within the token syntax, that's expected behavior as it will only return the first match.
You can use the Pattern Matching activity to create a new token. In this activity you can specify whether you want just the first match or all of them.
An alternative would be to use the Token Calculator activity and its Replace function to replace the single quote to with the empty string.
Thanks, although when I open the Token Calculator, it does not have Replace as a function (only Add, Subtract, Multiply, Sum, Average, Divide). What version are you referring to?
The Pattern Matching approach works - thanks!!
Julie
Oh, you're on an older version. The function set was expanded for Workflow 10.