I am trying to find multiple matches in my regex. Here is my regex
final Pattern p = Pattern.compile("^[0-9]{8}[#](FRI|SAT|SUN)[\r]$");
final Matcher m = p.matcher("09042012#SUN\r" + "09022012#FRI\r" + "09032012#SAT\r");
while (m.find())
{
final String result = m.group();
System.out.println(result);
}
this works if the string has just one match, but if its consecutive matches it doesn't work. I have tried adding .+ at the end of my regex to make sure it atleast have one match. That doesn't work either.
What am I doing wrong??