I have a String that is something like this:
A20130122.0000+0000-0015+0000_name
Then I would like to extract this information:
The 20130122.0000+0000-0015+0000
that will be parsed to a date later on.
And the final part which is name
.
So I am using in Java something like this:
String regexpOfdate = "[0-9]{8}\\.[0-9]{4}\\+[0-9]{4}-[0-9]{4}\\+[0-9]{4}";
String regexpOfName = "\\w+";
Pattern p = Pattern.compile(String.format("A(%s)_(%s)", regexpOfdate, regexpOfName));
Matcher m = p.matcher(theString);
String date = m.group(0);
String name = m.group(1);
But I am getting a java.lang.IllegalStateException: No match found
Do you know what I am doing wrong?