In my workbench I have a column full of strings where I'd like certain sequences of characters to be capitalized. I could do this by adding a StringReplacer for each sequence, but I have a lot of sequences and I'd rather not do that if I can solve the problem with a general solution. What I'd like to do is just use some StringReplacer like
Attributes: RAILWAY_NAME
Text to Find: Cpr|Cnr
Replacement Text: @UpperCase(\\0)
Use Regular Expressions: Yes
Case Sensitive: Yes
Where whatever it finds would be replaced with the upper case version. But when I try this on the string "Cnr Railway" nothing gets replaced. If I try it with the replacement text \\0+1 I get "Cnr+1 Railway", so I know the regex is matching correctly. If I try it with the replacement text @StringLength(\\0) I get "2 Railway", so it looks like functions take "\\0" as a literal string. But if that were the case why does @UpperCase(\\0) return "Cnr Railway"?
So my quesiton is:
1. Can I use FME String Functions on regex replacement text in a StringReplacer.
2. If yes, how. If no, is there an easy way to capitalize certain sequences of characters in a string.
I'm using FME Desktop 2013, if it matters.