题目:力扣https://leetcode-cn.com/problems/regular-expression-matching/
class Solution {
public boolean isMatch(String s, String p) {
//声明boolean数组dp
boolean[][] dp = new boolean[s.length()+1][p.length()+1];
dp[0][0] = true;
int num=0;
//初始化处理boolean数组
for(int i=1;i<s.length()+1;i++){
dp[i][0] = false;
}
for(int j=1;j<p.length()+1;j++){
if(p.charAt(j-1)=='*'){
dp[0][j] = dp[0][j-2];
}else if(p.charAt(j-1)=='.'){
dp[0][j] = dp[0][j-1];
num++;
if(j<p.length()&&p.charAt(j)=='*'){
num = 0;
}
}else{
dp[0][j] = false;