Project
Regex Engine (Python)
Medium
788 completions
~ 18 hours
4.2Learn about the syntax of regular expressions, practice working with the string type, parsing, and slicing, and get more familiar with boolean algebra and recursion.
Provided by
JetBrains Academy
About
Regular expressions are a fundamental part of computer science and natural language processing. In this project, you will write an extendable regex engine that can handle basic regex syntax, including literals (a, b, c, etc.), wild-cards (.), and metacharacters (?, *, +, ^, $).
Training project
This project allows you to practice and strengthen your coding skills, helping you get ready for more advanced tasks ahead.
What you'll learn
Once you choose a project, we'll provide you with a study plan that includes all the necessary topics from your course to get it built. Here’s what awaits you:
Implement a program that compares two single character strings (including the wildcard) and determines if there's a match.
Extend your engine to compare two equal length strings using recursion.
Add the ability to compare a regex to strings that vary in length.
Extend the engine to handle the operators ^ and $ that control the position of the regex within a string.
Support the additional operators ?, *, and + that control the repetition of a character within a string.
Finally, implement the backslash \ as an escape symbol that allows to use metacharacters as literals.
Reviews
5 days ago
It learned me how to deal with regex. It was fun.Also I learned how to deal with the situation of dead-end in the stage6. I had to go back to the stage 2 and to completely re-develop the project. It was my error. But it was fun to watch how minor mistakes at the beginning could stop the project nea ...
For me, recursive functions are not very intuitive topic and regular expression the same. At the end I felt very discouraged at the stage 5/6 but after carefully reading again the description text of the stage and a lot of tests, I have done everything. It is a good exercise.
4.2
Learners who completed this project within the Python Developer course rated it as follows: