public class RegexpUtil extends Object
Constructor and Description |
---|
RegexpUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
asOptions(boolean caseSensitive)
Convert flag to regex options.
|
static int |
asOptions(boolean caseSensitive,
boolean multiLine,
boolean singleLine)
Convert flags to regex options.
|
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
|
static boolean |
hasFlag(int options,
int flag)
Check the options has a particular flag set.
|
static int |
removeFlag(int options,
int flag)
Remove a particular flag from an int value contains the option flags.
|
public static int asOptions(boolean caseSensitive)
caseSensitive
- opposite of RegexpMatcher.MATCH_CASE_INSENSITIVEpublic static int asOptions(boolean caseSensitive, boolean multiLine, boolean singleLine)
caseSensitive
- opposite of RegexpMatcher.MATCH_CASE_INSENSITIVEmultiLine
- RegexpMatcher.MATCH_MULTILINEsingleLine
- RegexpMatcher.MATCH_SINGLELINEpublic static int asOptions(String flags)
flags
- the string containing the flagspublic static boolean hasFlag(int options, int flag)
options
- an int
valueflag
- an int
valuepublic static int removeFlag(int options, int flag)
options
- an int
valueflag
- an int
value