Top Description Constructors Methods
org.apache.tools.ant.util.regexp

public Class RegexpUtil

extends Object
Class Inheritance

Regular expression utilities class which handles flag operations.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the Regexp option bits
asOptions
(String
the string containing the flags
flags
)

convert regex option flag characters to regex options

g
Regexp.REPLACE_ALL
i
RegexpMatcher.MATCH_CASE_INSENSITIVE
m
RegexpMatcher.MATCH_MULTILINE
s
RegexpMatcher.MATCH_SINGLELINE
public static int

Returns:

the Regexp option bits
asOptions
(boolean
opposite of RegexpMatcher.MATCH_CASE_INSENSITIVE
caseSensitive
)

Convert flag to regex options.

public static int

Returns:

the Regexp option bits
asOptions
(boolean
opposite of RegexpMatcher.MATCH_CASE_INSENSITIVE
caseSensitive
,
boolean
RegexpMatcher.MATCH_MULTILINE
multiLine
,
boolean
RegexpMatcher.MATCH_SINGLELINE
singleLine
)

Convert flags to regex options.

public static boolean

Returns:

true if the flag is set
hasFlag
(int
an int value
options
,
int
an int value
flag
)

Check the options has a particular flag set.

public static int

Returns:

the options with the flag unset
removeFlag
(int
an int value
options
,
int
an int value
flag
)

Remove a particular flag from an int value contains the option flags.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RegexpUtilback to summary
public RegexpUtil()

Method Detail

asOptionsback to summary
public static int asOptions(String flags)

convert regex option flag characters to regex options

g
Regexp.REPLACE_ALL
i
RegexpMatcher.MATCH_CASE_INSENSITIVE
m
RegexpMatcher.MATCH_MULTILINE
s
RegexpMatcher.MATCH_SINGLELINE
Parameters
flags:String

the string containing the flags

Returns:int

the Regexp option bits

Since
Ant 1.8.2
asOptionsback to summary
public static int asOptions(boolean caseSensitive)

Convert flag to regex options.

Parameters
caseSensitive:boolean

opposite of RegexpMatcher.MATCH_CASE_INSENSITIVE

Returns:int

the Regexp option bits

Since
Ant 1.8.2
asOptionsback to summary
public static int asOptions(boolean caseSensitive, boolean multiLine, boolean singleLine)

Convert flags to regex options.

Parameters
caseSensitive:boolean

opposite of RegexpMatcher.MATCH_CASE_INSENSITIVE

multiLine:boolean

RegexpMatcher.MATCH_MULTILINE

singleLine:boolean

RegexpMatcher.MATCH_SINGLELINE

Returns:int

the Regexp option bits

Since
Ant 1.8.2
hasFlagback to summary
public static boolean hasFlag(int options, int flag)

Check the options has a particular flag set.

Parameters
options:int

an int value

flag:int

an int value

Returns:boolean

true if the flag is set

removeFlagback to summary
public static int removeFlag(int options, int flag)

Remove a particular flag from an int value contains the option flags.

Parameters
options:int

an int value

flag:int

an int value

Returns:int

the options with the flag unset