Removing regular expression to avoir stack overflow