org.apache.tools.ant.util.regexp

Class JakartaRegexpRegexp

Implemented Interfaces:
Regexp, RegexpMatcher

public class JakartaRegexpRegexp
extends JakartaRegexpMatcher
implements Regexp

Regular expression implementation using the Jakarta Regexp package

Fields inherited from interface org.apache.tools.ant.util.regexp.Regexp

REPLACE_ALL, REPLACE_FIRST

Fields inherited from interface org.apache.tools.ant.util.regexp.RegexpMatcher

MATCH_CASE_INSENSITIVE, MATCH_DEFAULT, MATCH_MULTILINE, MATCH_SINGLELINE

Constructor Summary

JakartaRegexpRegexp()
Constructor for JakartaRegexpRegexp

Method Summary

protected int
getSubsOptions(int options)
Convert ant regexp substitution option to apache regex options.
String
substitute(String input, String argument, int options)
Perform a substitution on the regular expression.

Methods inherited from class org.apache.tools.ant.util.regexp.JakartaRegexpMatcher

getCompiledPattern, getCompilerOptions, getGroups, getGroups, getPattern, matches, matches, setPattern

Constructor Details

JakartaRegexpRegexp

public JakartaRegexpRegexp()
Constructor for JakartaRegexpRegexp

Method Details

getSubsOptions

protected int getSubsOptions(int options)
Convert ant regexp substitution option to apache regex options.
Parameters:
options - the ant regexp options
Returns:
the apache regex substition options

substitute

public String substitute(String input,
                         String argument,
                         int options)
            throws BuildException
Perform a substitution on the regular expression.
Specified by:
substitute in interface Regexp
Parameters:
input - The string to substitute on
argument - The string which defines the substitution
options - The list of options for the match and replace.
Returns:
the result of the operation
Throws:
BuildException - on error

Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.