import java.util.*;
import java.io.*;

public class Util
{
    public static final char RULE_NAME_DELIMITER = ':';
    public static final char OR_DELIMITER = '|';
    public static final String RULE_DELIMITER = " ";

    public static final Vector<Rule> loadRules (String inputFile, boolean debug)
    {
        /*
         * Open the data file and read it in.
         */

        BufferedReader reader = null;
        Vector<Rule> values = new Vector<Rule>();

        try
        {
            String line = null;

            reader = new BufferedReader(new FileReader(inputFile));
         
            while (((line = reader.readLine()) != null) && (line.length() > 0))
            {
                int nameDelim = line.indexOf(RULE_NAME_DELIMITER);
                String name = line.substring(0, nameDelim);

                System.out.println("Rule name: "+name);

                int orDelim = line.indexOf(OR_DELIMITER);  // there's only ever a maximum of one of these in a rule

                System.out.println("orDelim "+orDelim);

                String dataOne = line.substring(nameDelim +1, ((orDelim == -1) ? line.length() : orDelim));
                String dataTwo = ((orDelim == -1) ? null : line.substring(orDelim +1));

                System.out.println("Rule one: "+dataOne);
                System.out.println("Rule two: "+dataTwo);

                String[] dataOneList = dataOne.trim().split(RULE_DELIMITER);
                String[] dataTwoList = (dataTwo == null ? null : dataTwo.trim().split(RULE_DELIMITER));

                if (dataOneList != null)
                {
                    for (int i = 0; i < dataOneList.length; i++)
                        System.out.println("Rule one list: "+dataOneList[i]);
                }

                if (dataTwoList != null)
                {
                    for (int i = 0; i < dataTwoList.length; i++)
                        System.out.println("Rule two list: "+dataTwoList[i]);
                }

                values.add(new Rule(name, dataOneList, dataTwoList));
            }
        }
        catch (Throwable ex)
        {
            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }

        return values;
    }

    public static final Vector<Message> loadMessages (String inputFile, boolean debug)
    {
        /*
         * Open the data file and read it in.
         */

        BufferedReader reader = null;
        Vector<Message> values = new Vector<Message>();

        try
        {
            String line = null;

            reader = new BufferedReader(new FileReader(inputFile));
            
            while (((line = reader.readLine()) != null) && (line.length() > 0))
            {
                // loop until blank line.
            }

            while ((line = reader.readLine()) != null)
            {
                values.add(new Message(line));
            }
        }
        catch (Throwable ex)
        {
            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }

        return values;
    }

    private Util ()
    {
    }
}
@@ -157,16 +157,58 @@
  = '%7C';%0A
+    public static final char MATCH = '%22';%0A
     publ
@@ -907,24 +907,139 @@
 : %22+name);%0A%0A
+                int matchDelim = line.indexOf(MATCH);%0A%0A                if (matchDelim == -1)%0A                %7B%0A    
             
@@ -1151,32 +1151,36 @@
                 
+    
 System.out.print
@@ -1196,32 +1196,36 @@
 im %22+orDelim);%0A%0A
+    
                 
@@ -1324,32 +1324,36 @@
                 
+    
 String dataTwo =
@@ -1417,32 +1417,36 @@
                 
+    
 System.out.print
@@ -1471,16 +1471,20 @@
 taOne);%0A
+    
         
@@ -1542,32 +1542,36 @@
                 
+    
 String%5B%5D dataOne
@@ -1607,32 +1607,36 @@
 ULE_DELIMITER);%0A
+    
                 
@@ -1720,24 +1720,28 @@
 LIMITER));%0A%0A
+    
             
@@ -1777,34 +1777,42 @@
                 
-%7B%0A
+    %7B%0A    
                 
@@ -1876,32 +1876,36 @@
                 
+    
 System.out.print
@@ -1950,35 +1950,43 @@
                 
+ 
-%7D%0A%0A
+   %7D%0A%0A    
                 
@@ -2018,32 +2018,36 @@
                 
+    
 %7B%0A              
@@ -2044,32 +2044,36 @@
                 
+ 
+   
 for (int i = 0; 
@@ -2093,32 +2093,36 @@
 st.length; i++)%0A
+    
                 
@@ -2191,32 +2191,36 @@
                 
+    
 %7D%0A%0A             
@@ -2214,32 +2214,36 @@
                 
+ 
+   
 values.add(new R
@@ -2276,24 +2276,229 @@
 aTwoList));%0A
+                %7D%0A                else%0A                %7B%0A                    // match is always one character%0A%0A                    values.add(new Rule(name, line.charAt(matchDelim +1)));%0A                %7D%0A
             

Update Util.java