can match basic pattern, still working on some infinite loop bugs