public class Grep
extends java.lang.Object
| Constructor and Description |
|---|
Grep() |
| Modifier and Type | Method and Description |
|---|---|
int |
getCount() |
java.lang.String |
getMatch() |
java.lang.String |
getMatch(int i) |
java.util.Iterator |
getMatches() |
java.lang.String |
grep()
Do the grep
|
void |
setAllmatches(boolean b)
If true, concatentates all matches into a single result, if false, only
the first match is returned in the result.
|
void |
setCanoneq(boolean b)
Sets the canoneq attribute for the regex.
|
void |
setCaseinsensitive(boolean b)
Sets the caseinsensitive attribute for the regex.
|
void |
setComments(boolean b)
Sets the comments attribute for the regex.
|
void |
setDotall(boolean b)
Sets the dotall attribute for the regex.
|
void |
setGroup(int g)
Set a specific group from the regex.
|
void |
setIn(java.lang.String string)
Where to look.
|
void |
setMultiline(boolean b)
Sets the multiline attribute for the regex.
|
void |
setRegex(java.lang.String regex)
What to look for.
|
void |
setSeparator(java.lang.String s)
Used in conjunction with
setAllmatches, this string will be
placed between each match in the final result. |
void |
setUnicodecase(boolean b)
Sets the unicodecase attribute for the regex.
|
void |
setUnixlines(boolean b) |
public void setIn(java.lang.String string)
string - The new in valuepublic void setRegex(java.lang.String regex)
regex - The new regex valuepublic void setGroup(int g)
g - The new group valuepublic void setDotall(boolean b)
b - The new dotall valuepublic void setCaseinsensitive(boolean b)
b - The new caseinsensitive valuepublic void setMultiline(boolean b)
b - The new multiline valuepublic void setUnicodecase(boolean b)
b - The new unicodecase valuepublic void setCanoneq(boolean b)
b - The new canoneq valuepublic void setComments(boolean b)
b - The new comments valuepublic void setUnixlines(boolean b)
public void setAllmatches(boolean b)
b - default is false, only show the first match.public int getCount()
public java.lang.String getMatch()
setSeparatorpublic java.util.Iterator getMatches()
public java.lang.String getMatch(int i)
ith match.public void setSeparator(java.lang.String s)
setAllmatches, this string will be
placed between each match in the final result.s - the separator, default is "".public java.lang.String grep()