4 Replies Latest reply on Nov 18, 2009 7:22 PM by 794113

    Count the number of occurences of a pattern in some files


      I am trying to extract some patterns in files using regex. I can easily extract the patterns using my program. I also wanted to count the number of occurences of the pattern in the files. For that I have written this code:
       int count=0;
                while (m.find())
                   System.out.println("Found Patterns: "+m.group());
             System.out.println(count);  //giving error saying identifier expected
      Unfortunately I am getting an error saying identifier expected at the count line. What to do?