The StringConcatenator will let you do this, you need to switch to the Advanced Editor to set it up
@ebygomm I did not know about that option. Tnx :)
It's also possible to use the StringReplacer to do the same thing.
Use regex to match the beginning of the string, and replace the beginning(which has 0 length) with the value you want
It's also possible to use the StringReplacer to do the same thing.
Use regex to match the beginning of the string, and replace the beginning(which has 0 length) with the value you want
Check. I knew about that transformer, but I didn't think about using it for this setting.
Nevertheless it doesn't seem to handle the @CurrentAttribute very well within the Replacement Text, or e.g. @Evaluate(...) within the string, whereas the StringConcatenator does work with these
Addendum.
I guess this doesn't really work so well due to the regex evaluation mode. For example, the brackets in @Evaluate(...) would be interpreted as a group, and probably string/math functions wouldn't be evaluated because it is performing the string as a regex, and not an (evaluation) expression
Check. I knew about that transformer, but I didn't think about using it for this setting.
Nevertheless it doesn't seem to handle the @CurrentAttribute very well within the Replacement Text, or e.g. @Evaluate(...) within the string, whereas the StringConcatenator does work with these
Addendum.
I guess this doesn't really work so well due to the regex evaluation mode. For example, the brackets in @Evaluate(...) would be interpreted as a group, and probably string/math functions wouldn't be evaluated because it is performing the string as a regex, and not an (evaluation) expression
The @CurrentAttribute isn't required, as you are only replacing the matched element, any unmatching parts, i.e. the rest of the attribute, remain as is. The replacement text just needs to include the text you want to add.
If you want to do anything more complicated you need to match the attribute as a group instead e.g. where \\1 is effectively your current attribute as the regex matches everything
I think you're correct that it won't work with @Evaluate though.
Check. I knew about that transformer, but I didn't think about using it for this setting.
Nevertheless it doesn't seem to handle the @CurrentAttribute very well within the Replacement Text, or e.g. @Evaluate(...) within the string, whereas the StringConcatenator does work with these
Addendum.
I guess this doesn't really work so well due to the regex evaluation mode. For example, the brackets in @Evaluate(...) would be interpreted as a group, and probably string/math functions wouldn't be evaluated because it is performing the string as a regex, and not an (evaluation) expression
Hi @ebygomm I know about the Regex options, and I have used this transformer before on multiple attributes.
My question for this topic was quite generic, where I would like to use evaluations using e.g. CurrentAttribute. That didn't work, and also e.g. @Evalutate(\\1*2) would work. This is no issue, since it does work for the StringConcatenator transfomer.
Thus, I already have my answer;
Arithmic evaluations on groups of attributes -> ExpressionEvaluator
Text (and/or arithmic) evaluations on groups of attributes -> StringConcatenator
Regex evaluations on groups of attributes -> StringReplacer