Project

Regex Engine (Go)

Hard
79 completions
~ 10 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:
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

Mi Sha avatar
Mi Sha
3 months ago
A little bit hard task #5 but good for practice with strings, slice expressions and understand of regexes. so my opinion is you definitely should do this task.
Will Rose
11 months ago
I really wish we could get the full output of the test your run against our code. Would be very helpful in troubleshooting.
Peter Jarvis avatar
Peter Jarvis
11 months ago
What a fantastic project—I love it! I now want to go back and read the Dragon book (again) and explore this from an NFA (nondeterministic finite automaton) perspective.

4.1

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