RegEx stands for Regular Expressions.
It is a way to flexibly search for patterns in text using symbols to represent different options.
RegEx can be useful for things like:
Slash\Escape is a text-based RegEx learning game.
To start, scroll down, choose your difficulty and hit the "new game" button.
You will be told a story. At each step you need to write RegEx to make choices.
If you get it right, you'll progress, if you get it wrong - you won't.
To play - write your answer into the form and press enter or hit "submit" you don't need to write any formulas with your answer, just write the exact regex you want to use.
There will be a glowing red ? in the top right hand corner of your screen.
Click that button for :
If you complete the game you'll activate speed-mode.
Text will come up immediately after each stage.
If you complete on True RegEx mode you'll get a custom Tweet telling everyone how fast you did it and how many lives you have left. You know - for all the bragging rights.
Check out my blog for my other projects.
There is no timer
You can get it wrong as many times as you like.
Make the most of your time - feel free to use tools like regex101 to check your answers.
Three lives. Two minutes on the timer.
Every wrong answer - lose a life or lose time.
Every right answer - gain time. The shorter your RegEx, the more time you'll get.
In RegEx . doesn't mean "full stop" - it means "any character".
* means "repeat the last thing any number of times, including 0".
So if we write .* we'll match any kind of character any number of times (basically .* means "anything").
It can be useful to really flexibly match a block of text.
For example, we might have to say "extract everything after this point. " or "ignore everything until you see a specific thing." Using .* means we don't have to worry about all the possible ways our text might change.
What we've learned
|plain text||matches itself|
|.||(full stop) one of anything|
|*||repeat between 0 and infinity times|