###### Regular Expression Matching 递归

* 代表可以匹配 0个 或 多个 前导字符;
. 代表可以匹配任意一个字符;

class Solution {
private:
bool matchHelper(string &s, string &p, int i, int j) {
if(p[j] == '\0') {
return s[i] == '\0';
}
if(p[j+1] != '*') {
if((s[i] == p[j]) || (p[j] == '.' && s[i] != '\0')) {
return matchHelper(s, p, i+1, j+1);
}else {
return false;
}
}
while((s[i] == p[j]) || (p[j] == '.' && s[i] != '\0')) {
if(matchHelper(s, p, i, j+2)) {
return true;
}
++i;
}
return matchHelper(s, p, i, j+2);
}
public:
bool isMatch(string s, string p) {
return matchHelper(s, p, 0, 0);
}
};

#### Regular Expression Matching -- LeetCode

2014-03-16 16:16:06

#### Regular Expression Matching 正则表达式匹配和递归

2015-06-16 18:17:29

#### LeetCode-10-Regular-Expression-Matching 递归模拟正则表达式

2017-09-05 13:18:02

#### 10. Regular Expression Matching-动态规划/递归回溯

2016-09-11 21:40:08

#### (leetcode #10)Regular Expression Matching --递归法

2016-01-28 12:06:20

#### Regular Expression Matching问题及解法

2017-03-01 12:57:56

#### Regular Expression Matching

2015-11-30 22:46:48

#### LeetCode题解--10. Regular Expression Matching

2016-04-03 11:40:23

#### 10. Regular Expression Matching（很重要!!!）

2016-08-15 17:15:09

#### [LeetCode] 010. Regular Expression Matching (Hard) (C++/Java/Python)

2015-03-02 11:20:51

## 不良信息举报

Regular Expression Matching 递归