fixed pattern match bug. added few pattern flags: 'digit', 'alpha', 'alphanum'.