Stupid ndfa-based regexp implementation