package jpower.core.utils;

import java.util.Scanner;
import java.util.regex.Pattern;

/**
 * Scans a String for Patterns
 */
public class StringScanner
{
   private Scanner scanner;

   /**
    * Creates a new String Scanner
    *
    * @param str input string
    */
   public StringScanner(String str)
   {
      scanner = new Scanner(str);
   }

   /**
    * Find the next string matching the pattern
    * @param pattern pattern
    * @return matched
    */
   public String scan(String pattern)
   {
      return scanner.next(pattern);
   }

   /**
    * Find the next string matching the pattern
    * @param pattern pattern
    * @return matched
    */
   public String scan(Pattern pattern)
   {
      return scanner.next(pattern);
   }
}

@@ -512,32 +512,40 @@
  return scan
-ner.next
+(Pattern.compile
 (pattern);%0A 
@@ -537,24 +537,25 @@
 ile(pattern)
+)
 ;%0A   %7D%0A%0A   /
@@ -732,22 +732,940 @@
 ner.
-next(pattern);
+hasNext(pattern) ? scanner.next(pattern) : null;%0A   %7D%0A%0A   /**%0A    * Skips over the specified pattern%0A    *%0A    * @param pattern pattern%0A    */%0A   public void skip(Pattern pattern)%0A   %7B%0A      scanner.skip(pattern);%0A   %7D%0A%0A   /**%0A    * Skips over the specified pattern%0A    *%0A    * @param pattern pattern%0A    */%0A   public void skip(String pattern)%0A   %7B%0A      scanner.skip(pattern);%0A   %7D%0A%0A   /**%0A    * Skips over the specified pattern until it no longer matches%0A    *%0A    * @param pattern pattern%0A    */%0A   @SuppressWarnings(%22StatementWithEmptyBody%22)%0A   public void skipUntil(String pattern)%0A   %7B%0A      while (scan(pattern) != null)%0A      %7B%0A         ;%0A      %7D%0A   %7D%0A%0A   /**%0A    * Skips over the specified pattern until it no longer matches%0A    *%0A    * @param pattern pattern%0A    */%0A   @SuppressWarnings(%22StatementWithEmptyBody%22)%0A   public void skipUntil(Pattern pattern)%0A   %7B%0A      while (scan(pattern) != null)%0A      %7B%0A         ;%0A      %7D
 %0A   

Add Super Awesome String Scanner Stuff