I have the following Java code:
String data = "MaxL-450";
if(!data.matches("MaxL\\-*"))
throw new IllegalArgumentException("Did not match.");
When I execute it, the exception is thrown, because apparently the regex doesn't match my data string. Is there something wrong with my regex or is something else going on here? Thanks in advance.