ca.ucalgary.seahawk.services
Class RegexParser
java.lang.Object
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.
RegexParser
public RegexParser()
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
Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010