From the line
D:\csv\rssi_data_upload_00_11_74_86_49_7F_1519231770
I need to execute the regular expression
upload_(.+)_[0-9]+
to obtain the value of 00_11_74_86_49_7F
.
This is my code:
public static void main(String[] args) throws FileNotFoundException
{
String query_MAC_AP="upload_(.+)_[0-9]+";
Pattern pmacap = Pattern.compile(query_MAC_AP);
Matcher mmacap=pmacap.matcher("D:\csv\rssi_data_upload_00_11_74_86_49_7F_1519231770");
mmacap.matches();
String mac_AP=mmacap.group(1);
System.out.println(mac_AP);
}
Every time I run it I get the following error
Exception in thread "main" java.lang.IllegalStateException: No match found at java.util.regex.Matcher.group(Unknown Source) at tfc.Main.main(Main.java:30)
What have I got wrong?