Hello,
I have a Quick Fields session that captures a date off the image. I noticed it was commonly grabbing O, uppercase i, and lowercase L instead of 0, 1 and 1, respectively.
So, in order to try to maximize what Quick Fields can do, I changed my pattern from \d{2}/\d{2}/\d{4} to \w{2}/\w{2}/\w{4} , with the idea that I could capture those incorrect characters and just substitute them out (rather than get nothing because the letters cause it to find no match). But, I can't figure out how to configure the Substitution activity to sub out multiple characters from the same token, and then put that final token into the date template field. What's the proper way to do that? Feels like I'm missing something simple.
Thanks!
Question
Question
Quick Fields - Substitution - Proper way to substitute multiple characters out of token
Answer
Substitution works a little different from the standalone pattern matching activity.
By default, substitution will replace all matches, but the pattern for a substitution should only be matching on the specific things you want to replace.
You could add two substitutions, one for the 0s and one for the 1s. If you're referencing a non-system token, like the token generated by our initial pattern matching, you can have the substitution replace the original value with the result.
For example,
To replace "O" with 0
Then another to replace "l" and "I"
The pattern is hard to read in the second screenshot, but it is [lI] (brackets form a character group so it can match on either of the two characters).
The "Match Case" option can be enabled/disabled depending on how selective you want it to be, but if you enable "Replace the input token's value" it will feed the substitutions right back into the original token so you can keep the field assignment the same.