Version: 1.1.1

ca.ucalgary.seahawk.services
Class RegexParser

java.lang.Object
  extended by ca.ucalgary.seahawk.services.RegexParser

public class RegexParser
extends Object

This class contains methods for extracting parts of regular expressions, mainly for use in MobyComplexBuilder in dealing with nested rules, etc.


Constructor Summary
RegexParser()
           
 
Method Summary
static int[] getCaptureGroupRange(Pattern pat, int groupNumber)
           
static int[] getCaptureGroupRange(Pattern pat, int groupNumber, boolean includeQuantifier)
           
static String getCaptureGroupRegex(Pattern pat, int groupNumber)
          Parses out the capture group corresponding to the given number in the pattern that produced the given matcher.
static int groupCount(Pattern pat)
           
static boolean isPosixCharacterClass(String className)
           
static int locationToCaptureGroupNumber(String seahawkPattern, int targetPosition)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexParser

public RegexParser()
Method Detail

isPosixCharacterClass

public static boolean isPosixCharacterClass(String className)

locationToCaptureGroupNumber

public static int locationToCaptureGroupNumber(String seahawkPattern,
                                               int targetPosition)
                                        throws Exception
Throws:
Exception

getCaptureGroupRegex

public static String getCaptureGroupRegex(Pattern pat,
                                          int groupNumber)
                                   throws Exception
Parses out the capture group corresponding to the given number in the pattern that produced the given matcher. Does not include any quantity modifier on the capture group, e.g. in (\d)+, the '+' would not be included.

Throws:
Exception

getCaptureGroupRange

public static int[] getCaptureGroupRange(Pattern pat,
                                         int groupNumber)
                                  throws Exception
Throws:
Exception

groupCount

public static int groupCount(Pattern pat)

getCaptureGroupRange

public static int[] getCaptureGroupRange(Pattern pat,
                                         int groupNumber,
                                         boolean includeQuantifier)
                                  throws Exception
Throws:
Exception

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010