What is a regular expression?
- Regular expressions, also known as regex or RE, are a concept in computer science. They are typically used to search for and replace text that matches a given pattern (rule).
- Simply put, it matches strings. We usually use Ctrl+F to search for strings in Notepad or a browser; this is a direct string match search. To perform a broader matching pattern, we can use regular expressions. For a simple example, to extract all numbers from a text, the regular expression would be:
\d+As shown in the picture below

What is the purpose of regular expressions?
Perform operations on the matched content.
What exactly can it do?
- Delete the matched content.
- Replace the matched content.
- Other examples include counting how many times a number appears, as in the example above.
Example of the delete function in Little Flying Rabbit
To delete all scripts in an HTML file, the expression code would be:<script[^>]*?>.*?</script>As shown in the picture:
