Following regex giving me java.lang.IllegalStateException: No match found
error
String requestpattern = \"^[A-Za-z]+ \\\\/+(\\\\w+)\";
Pattern p
Your expression requires one or more letters, followed by a space, followed by one or more forward slashes, followed by one or more word characters. Your test string doesn't match. The exception is triggered because you're trying to access a group on a matcher that returns no matches.
Your test string matches up to the slash after "upload", because the slash isn't matched by \w
, which only includes word characters. Word characters are letters, digits, and underscores. See: http://www.regular-expressions.info/charclass.html#shorthand