I'm trying to use the Replace Text action to add variables to a PHP file. I want each new variable to be on a new line. The way I have it setup is like this:
$variable1 = "whatever";
//add new var
I replace the text "//add new var" with the new variable to be added. But I also need to add "//add new var" on the next line so as to add other variables in the future.
I tried something like this, Replace With: $variable2 = "whatever2";\n//add new line
But it doesn't make \n into a new line. I tried checking the box "Use Regular Expressions for find and replace" but got the same result. Is it possible to make a new line using the Replace Text action?



Hello there! You cannot use \r?\n in the replacement string of regular expressions (you can see that if you try to do a replacement with \r?\n in Expresso) . There are 2 alternatives that you may want to consider:
- You can use the "Append Line To Text" action (under "Text Actions" category):
Most people don't know the specific action and it can help you with the issue that you are facing.
- You can also use the "Split Text" action with custom delimiter (i.e. the text that you want to replace) and "Join Text" with standard delimiter (i.e. NewLinex1).
==Dedicated Automation Solutions==
==Dedicated Automation Solutions==