In this video, I will show you how to use ChatGPT to generate a regular expression that can be used to find and replace dynamic values in your make scenario. My name is Andy O’Neill and I help entrepreneurs like you add automation to your business.
Recently, I was working on a scenario to manage newsletters in my inbox. I needed to remove the user number from links to my Gmail inbox messages. I used ChatGPT to create a regular expression that matches ‘you slash’ and the numeric value after ‘you slash’ for example URLs.
Here is an example URL: ‘you/123’. I wanted to remove the ‘123’ from the message URL. The techniques I’ll show you in this video will work for any dynamic value that’s in a predictable URL or a block of code or text.
To create the regular expression, I had to sweet-talk ChatGPT a few times to get the correct outcome. But after some trial and error, I got the desired result.
Once we have the regular expression, we can use it in the ‘make’ platform to replace the dynamic values. I set up a scenario with a ‘parse CSV’ module to get the example URLs and a ‘replace text’ function module to perform the replacement.
There are two ways to use the regular expression for find and replace. One way is to use the ‘replace text’ function module and specify the regular expression pattern and the new value to replace the dynamic value. Another way is to use the ‘compose string’ module and use the ‘replace’ function with regular expression to remove the dynamic value.
In the video, I demonstrate both methods and show you how they can be used in different scenarios. The ‘replace text’ function module is more efficient as it saves an operation for each conversion. However, if you’re not comfortable with regular expressions, the ‘compose string’ method using the ‘replace’ function is a simpler alternative.
I hope you found this video helpful. If you did, please hit the like button and consider subscribing to my channel for more automation tips. If you need one-on-one assistance with your automations, you can book a session with me or my team. You can find the documentation links for the ‘make replace’ function and the ‘make replace text’ module in the video description.
Thank you for watching!