Project

Regex Engine (Python)

Medium
783 completions
~ 18 hours
4.1

Learn 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 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 icon

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:
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

Erik Panjtar avatar
Erik Panjtar
2 weeks ago
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.
Сергей Васильев avatar
Сергей Васильев
5 months ago
Tough project, which shows importance of considering making correct structure from scratch for further scale. Recommended
Guillaume Konen avatar
Guillaume Konen
1 year ago
Very challenging project, I was not used to recursion and it was a good training. The test cover a lot of special cases so I need to be very precise. The site give us good explanation for the good direction so i did not feel lost. This project really pushed me beyond my limits and it is exactly why ...

4.1

Learners who completed this project within the Python Developer course rated it as follows:
Usefulness
4.4
Fun
4.0
Clarity
4.1