Driver code
public static void main ( String [ ] args ) { String str = " ABABABA " ; String pat = " A # B # A " ; if ( regexMatch ( str , pat ) ) System . out . println ( " yes " ) ; else System . out . println ( " no " ) ; } }