English to Regex thanks to GPT-3?
Perhaps you can spend less time searching for regular expressions online — check out this demo
This is a short article about one possible feature resulting from the new GPT-3 by OpenAI based on a prototype-demo posted on Twitter. I realise not everyone knows what ‘regex’ is, so I thought I would explain. A “regular expression” (regex) is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for “find” or “find and replace” operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory.
I wrote a short piece on GPT-3 yesterday, however to sum up, according to a journalist in MIT Technology Review: “GPT-3 is the most powerful language model ever.” That may be an over-statement. However, the model has 175 billion parameters and can generate almost any kind of text. Although, it has severe limitations, such as occasionally spewing hateful racist or sexist language, as it is partly trained on large text structures on the web.
Following this I discovered a tweet from Parthi Loganathan, that I immediately checked out and retweeted.
He created a short website where you can sign up for early access.
On this website he made a short video, and I turned it into a GIF to fit on Medium.
The idea is that you can:
- Described the regex you want.
- Provide an example of a string that will match.
- Generate the regex.
Since I am currently looking at an analysis of text I thought this was clever.
It is not likely I will be able to use this any time soon.
Additionally, it must be said that a regex generator based on giving descriptions to automatically generate regex does not mean one can neglect learning about regular expressions.
You already have RegExr: “Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.”
RegExr: Learn, Build, & Test RegEx
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference…
Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and…
You can also find a lot of information on Regular Expression.
Regular-Expressions.info - Regex Tutorial, Examples and Reference - Regexp Patterns
A regular expression (regex or regexp for short) is a special text string for describing a search pattern. You can…
As well as a practical cheat sheet!
Regex Cheat Sheet
Regular Expressions Syntax Reference. Includes tables showing syntax, examples and matches.
As well as specifically for Python:
A RegEx, or Regular Expression, is a sequence of characters that forms a search pattern. RegEx can be used to check if…
So, I hope you find this article helpful, and the prospect of descriptions to generate RegEx too.
This is #500daysofAI and you are reading article 417. I am writing one new article about or related to artificial intelligence every day for 500 days.