public class AwfulRegEXPMatcher { /** Create a matcher with the given regular exPRession and which will Operate on the given input string */ public AwfulRegExpMatcher(String regExp, String inputText); /** Retrieve the next match of the pattern against the input text, returning the matched text if possible or null if not */ public String getNextMatch(); }
public class BadRegExpMatcher { public BadRegExpMatcher(String regExp); /** Attempts to match the specified regular expression against the input text, returning the matched text if possible or null if not */ public String match(String inputText); /** Get the next match against the input text, or return null if no match */ public String getNextMatch(); }
class BetterRegExpMatcher { public BetterRegExpMatcher(...); /** Provide matchers for multiple formats of input -- String, character array, and subset of character array. Return -1 if no match was made; return offset of match start if a match was made. */ public int match(String inputText); public int match(char[] inputText); public int match(char[] inputText, int offset, int length); /** Get the next match against the input text, if any */ public int getNextMatch(); /** If a match was made, returns the length of the match; between the offset and the length, the caller should be able to reconstrUCt the m