added regex matching (NFA based)