Added better version of looking for restricted string without stack
overflow exceptions