The replacement field is a token field. It is not processed by the regular expression system, so nothing related to the ICU Core regular expression characters applies to the replacement text. So the meaning of \n
is not that of the regular expression, instead it is that of the Keyboard Maestro Token processing.
Keyboard Maestro token fields process (by default) tokens and backslash characters, but regular expression fields (like the first one) do not process backslash characters because they are handled by the regular expression system.
So, in the replacement field, with Keyboard Maestro processing tokens and backslash characters, if you put a token (eg %Variable%Local Replace%
) or a backslash character (eg \n
), then they will be processed - but this processing does not happen recursively - results from the first round of processing are not then reprocessed.
So if you want a return character in the result, then the Local Replace had better have a return character in it, not \n
.
The question is then, how are you setting the Local Replace
variable. Because, by default, if you used the Set Variable to Text action, and it had \n
, that would be interpreted at that point as a return character and the variable would contain a return character.
If you are getting it from somewhere else, and you want to the add an extra level of processing, you could use the Filter action with the Process Tokens option. But note then it has to be a proper token text. If you, for example, had the text with percentage characters in there, then they should be doubled.