Searching strings using regular expressions
Here is my code.
String tmpStr = "This {11} is a {2} simple string {3}";
int tmpFromIndex = 0;
int tmpToIndex = 0;
while ((tmpToIndex = tmpStr.indexOf("\\d{1, 2}", tmpFromIndex)) != -1)
{
String tmpCurrentTmpStr = tmpStr.substring(tmpFromIndex, tmpToIndex);
tmpFromIndex = tmpToIndex;
}
The tmpStr.indexOf("\\d{1, 2}") construction, which matches numbers in the given string always returns -1. How can I use it ?

