at Rubular i was testing my Regular expression:
(\d+).html
Test string:
"/magnoliaAuthor/Services/services/07.html"
Just as I needed, I returned "07" as the first match group. Perfect. I need this regex in an Java environment, so I wrote this piece of code:
import java.util.regex.*;
class Main
{
public static void main (String[] args)
{
String jcrPath = "/magnoliaAuthor/Services/services/07.html";
Pattern pattern = Pattern.compile("(\\d+).html");
Matcher matcher = pattern.matcher(jcrPath);
System.out.println(matcher.group());
}
}
As explained here, I added anothere \ to my regex. Sadly for me, when compiling and running the code, I get the following exception: java.lang.IllegalStateException: No match found
Does anybody know why there aren't any matches?