title: Eclipse "String variable can not be resolved to a variable"
body: <p>Here is the code, There is no way str2Check is out of scope.</p>
  
  <pre><code>public static void regexChecker(String theRegex, String str2Check)
      {
          //defining the regex pattern
  
          Pattern checkRegex = Pattern.compile(theRegex);
  
          // Creating a Matcher object that searches the string for anything that
          //matches the REGEX
  
          Matcher regexMatcher = checkRegex.matcher(str2Check); //error here
  
          while (regexMatcher.find())
          {   
              System.out.println(regexMatcher.group());
              System.out.println("Start Index: " + regexMatcher.start());
              System.out.println("End Index: " +  regexMatcher.end());
          }
      }
      public static void main(String[] args) {
          // TODO Auto-generated method stub
  
          String longString = " Derek Banas CA 12345 PA (412)555-1212 johnsmith@hotmail.com 412-555-1234 412 555-1234 "; 
          String strangeString = " 1Z aaa **** *** {{{ {{ { ";
  
          regexChecker("\\s[A-Za-z]{2,20}",longString);
  
      }
  </code></pre>
  
  <p>Please help out. Being scratching my head....Can't able to comprehend it at all.</p>