I am using Regex API to filter some text. I want to find the following pattern:
*-*.html
A dash has to appear in the file name.
String patternStr = "[A-Za-z0-9]*.html";
Pattern pattern = Pattern.compile(patternStr);
String str1;
while ((str1 = in.readLine()) != null) {
Matcher matcher = pattern.matcher(str1);
while(matcher.find())
{
int start = matcher.start();
int end = matcher.end();
System.out.println(str1.subSequence(start, end));
}
I don't know how to include dash (-) in the pattern string.