I am trying to find the position of string that matches the regular expression in a given 'word'. But for some reason I get the following Exception.
Exception in thread "main" java.lang.IllegalStateException: No match available
I have created a small program that demonstrates the problem, posted below. I would really appreciate some input on this. thanks