small change to createNFA method in RegExFunc