RegEx Replace
RegEx Replace is one of the most useful Actions that you can add to your flows. It will allow you to automate the way you update documents inside your flows.
Let's assume that you have a template file that you wish to use with several of your customers and the only thing you wish to change is the contact email address.
1. Create a new process and give it a name.
2. Drag the Regex Replace action to the canvas and link it to the other actions.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/nRvd6h64EDPzXhfPfsKqV_image.png?format=webp)
3. Click the Regex Replace action to access its configurations and click the button Regex Configurations.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/thW7Gdj4Vq6VvB0p12tc3_image.png?format=webp)
- <%stringToSearchIn%> - variable that has the default text saved as Default value.
- <%reGexExpression%> - variable that has the Regex Value saved as Default value. The Regex is "([_\.0-9a-zA-Z-]+@([\-0-9a-zA-Z]+\.)+[a-zA-Z]{2,6})".
- <%updatedText%> - variable that will hold the modified text.
- <%email%> - input variable that will ask the email that the regex expression will use.
If you wish to search the text regardless the case check the Ignore case checkbox.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/OJ4nWN2mNtpH6V0EVFfDR_image.png?format=webp)
5. Save and Validate the process.
6. Each time you will run the process you are expected to add the new email address you wish to us.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/3NdEc7he4nzDWQCurhHDX_image.png?format=webp)
7. Because we have created <%updatedText%> of type output, when you click Check instances you will be able to see that the text was updated.
![Doc contributor](https://s3.amazonaws.com/archbee-animals/koala.png)