Draft

Regular Expression Style Matching

Description:

Given an input string s and a pattern p, implement regular expression style matching with support for . and *.

. Matches any single character. * Matches zero or more of the preceding element. The matching should cover the entire input string (not partial).

Here's the catch:
To ensure a challenge, the re module for Python will not be permitted.

Note:

  • s could be empty and contains only lowercase letters a-z.
  • p could be empty and contains only lowercase letters a-z, and characters like . or *.

Example 1:
Input:
s = "aa"
p = "a"
Output: false
Explanation: "a" does not match the entire string "aa".

Example 2:
Input:
s = "aa"
p = "a*"
Output: true
Explanation: '*' means zero or more of the precedeng element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".

Regular Expressions

Similar Kata:

Stats:

CreatedApr 3, 2019
Warriors Trained30
Total Skips0
Total Code Submissions23
Total Times Completed6
Python Completions5
Total Stars0
% of votes with a positive feedback rating0% of 2
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes2
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • ChrisKalahiki Avatar
Ad