comefrom: <gouthampradhan>backtracking_RegularExpressionMatching_1.java
code: private boolean backTrack(int si, int pi, String s, String p) {
      if (si >= s.length() && pi >= p.length())
        return true; 
      else {
        if (pi >= p.length()) return false; 
        else if (si >= s.length()) {
          if (pi + 1 < p.length() && p.charAt(pi + 1) == '*') {
            return backTrack(si, pi + 2, s, p);
          } else
            return false; 
        } else if (s.charAt(si) == p.charAt(pi) || p.charAt(pi) == '.') {
          if (pi + 1 < p.length() && p.charAt(pi + 1) == '*') {
            if (backTrack(si, pi + 2, s, p)) return true;
            for (int i = si, l = s.length(); i < l; i++) {
              if (s.charAt(i) == p.charAt(pi) || p.charAt(pi) == '.') {
                if (backTrack(i + 1, pi + 2, s, p)) return true;
              } else {
                return false;
              }
            }
            return backTrack(s.length(), pi, s, p);
          } else {
            return backTrack(si + 1, pi + 1, s, p); 
          }
        } else {
          if (pi + 1 < p.length() && p.charAt(pi + 1) == '*') {
            return backTrack(si, pi + 2, s, p);
          } else return false;
        }
      }
    }
masked: private boolean sample_funcname ( int si , int pi , String s , String p ) {
    if ( si >= s . length ( ) && pi >= p . length ( ) ) return true ;
    else {
      if ( pi >= p . length ( ) ) return false ;
      else if ( si >= s . length ( ) ) {
        if ( pi + 1 < p . length ( ) && p . charAt ( pi + 1 ) == '*' ) {
          return backTrack ( si , pi + 2 , s , p ) ;
        }
        else return false ;
      }
      else if ( s . charAt ( si ) == p . charAt ( pi ) || p . charAt ( pi ) == '.' ) {
        if ( pi + 1 < p . length ( ) && p . charAt ( pi + 1 ) == '*' ) {
          if ( backTrack ( si , pi + 2 , s , p ) ) return true ;
          for ( int i = si , l = s . length ( ) ;
          i < l ;
          i ++ ) {
            if ( s . charAt ( i ) == p . charAt ( pi ) || p . charAt ( pi ) == '.' ) {
              if ( backTrack ( i + 1 , pi + 2 , s , p ) ) return true ;
            }
            else {
              return false ;
            }
          }
          return backTrack ( s . length ( ) , pi , s , p ) ;
        }
        else {
          return backTrack ( si + 1 , pi + 1 , s , p ) ;
        }
      }
      else {
        if ( pi + 1 < p . length ( ) && p . charAt ( pi + 1 ) == '*' ) {
          return backTrack ( si , pi + 2 , s , p ) ;
        }
        else return false ;
      }
    }
  }
  