Post by account_disabled on Mar 11, 2024 6:28:13 GMT
Regular expressions (RegEx) are not very intuitive, but very powerful for redirection and data analysis. How can we leverage GPT-3 and artificial intelligence to create them for us? Let's see an experiment and a detailed guide. Alessio Pomaro Alessio Pomaro Mar 2, 2022 •7 min read How to create regular expressions (RegEx) with GPT-3 on Google Sheets How to create regular expressions (RegEx) with GPT-3 on Google Sheets Regular expressions ( RegEx ) , there is no denying it, are difficult for everyone... even for the most expert professionals. Thanks to the use of GPT-3 , therefore artificial intelligence , it is possible to implement a system that can help by transforming textual instructions ( in natural language ) into RegEx.
In the video below, we see an experiment in action in a Google Sheet. GPT-3: from India Mobile Number Data natural language to regular expression generation (RegEx) Through the following button, you can create a copy of the Google Sheet used in the video. In the following paragraphs I explain in detail how to use it. NOTE : the sheet was updated in November 2022 with a completely renewed prompt to improve the performance of GPT-3 and with the update of the remote call to use the " text-davinci-002 " engine, which is the latest version. Create a copy of the Google Sheet If you are already familiar with the " RegEx " and " GPT-3 " topics, you can skip the following paragraphs and go straight to the instructions.
What are regular expressions (RegEx) These are sequences of symbols that identify text strings. For example, if you needed to identify all the URLs in a large list that contain the string " /news/ " followed by a title and a numeric code, a RegEx would be the perfect solution. As I said in the introduction, they can be unintuitive to use, but the difficulty is proportional to the power of the medium. Knowing RegEx is a transversal skill that finds applications practically everywhere for those who work in the world of the web ( and extends far beyond ). To give some examples: in SEO , in the migration phase ( e.g. 301 redirect ), in tool.
In the video below, we see an experiment in action in a Google Sheet. GPT-3: from India Mobile Number Data natural language to regular expression generation (RegEx) Through the following button, you can create a copy of the Google Sheet used in the video. In the following paragraphs I explain in detail how to use it. NOTE : the sheet was updated in November 2022 with a completely renewed prompt to improve the performance of GPT-3 and with the update of the remote call to use the " text-davinci-002 " engine, which is the latest version. Create a copy of the Google Sheet If you are already familiar with the " RegEx " and " GPT-3 " topics, you can skip the following paragraphs and go straight to the instructions.
What are regular expressions (RegEx) These are sequences of symbols that identify text strings. For example, if you needed to identify all the URLs in a large list that contain the string " /news/ " followed by a title and a numeric code, a RegEx would be the perfect solution. As I said in the introduction, they can be unintuitive to use, but the difficulty is proportional to the power of the medium. Knowing RegEx is a transversal skill that finds applications practically everywhere for those who work in the world of the web ( and extends far beyond ). To give some examples: in SEO , in the migration phase ( e.g. 301 redirect ), in tool.