Recca Chao 的 gitHub page

推廣網站開發,包含 Laravel 和 Kotlin 後端撰寫、自動化測試、讀書心得等。Taiwan Kotlin User Group 管理員。

View on GitHub

Problem 25

Description

This problem was asked by Facebook.

Implement regular expression matching with the following special characters:

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.

Solutions