Skip to content

Files

Latest commit

f245d0f · Mar 21, 2025

History

History

problem25

Daily Coding Problem

Note: Continuous improvements and bug fixes are made within the repository to produce better solutions.

Day 25

Implement regular expression matching with the following special characters:

  • . (period) which matches any single character
    • (asterisk) which matches zero or more of the preceding element

That is, implement a function that takes in a string and a valid regular expression and returns whether or not the string matches the regular expression.

For example, given the regular expression "ra." and the string "ray", your function should return true. The same regular expression on the string "raymond" should return false.

Given the regular expression ".*at" and the string "chat", your function should return true. The same regular expression on the string "chats" should return false.

This problem was asked by Facebook.

Solution | Tests