| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> |
| 2 |
<!--NewPage--> |
| 3 |
<HTML> |
| 4 |
<HEAD> |
| 5 |
<!-- Generated by javadoc on Sun Jun 16 19:34:41 GMT+04:00 2002 --> |
| 6 |
<TITLE> |
| 7 |
: Package jregex |
| 8 |
</TITLE> |
| 9 |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> |
| 10 |
</HEAD> |
| 11 |
<BODY BGCOLOR="white"> |
| 12 |
|
| 13 |
<!-- ========== START OF NAVBAR ========== --> |
| 14 |
<A NAME="navbar_top"><!-- --></A> |
| 15 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| 16 |
<TR> |
| 17 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 18 |
<A NAME="navbar_top_firstrow"><!-- --></A> |
| 19 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| 20 |
<TR ALIGN="center" VALIGN="top"> |
| 21 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 22 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> |
| 23 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> |
| 24 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 25 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 26 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 27 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 28 |
</TR> |
| 29 |
</TABLE> |
| 30 |
</TD> |
| 31 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 32 |
</EM> |
| 33 |
</TD> |
| 34 |
</TR> |
| 35 |
|
| 36 |
<TR> |
| 37 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 38 |
PREV PACKAGE |
| 39 |
<A HREF="../jregex/util/io/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> |
| 40 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 41 |
<A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A> |
| 42 |
<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| 43 |
</TR> |
| 44 |
</TABLE> |
| 45 |
<!-- =========== END OF NAVBAR =========== --> |
| 46 |
|
| 47 |
<HR> |
| 48 |
<H2> |
| 49 |
Package jregex |
| 50 |
</H2> |
| 51 |
|
| 52 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 53 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 54 |
<TD COLSPAN=2><FONT SIZE="+2"> |
| 55 |
<B>Interface Summary</B></FONT></TD> |
| 56 |
</TR> |
| 57 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 58 |
<TD WIDTH="15%"><B><A HREF="MatchIterator.html"><I>MatchIterator</I></A></B></TD> |
| 59 |
<TD> </TD> |
| 60 |
</TR> |
| 61 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 62 |
<TD WIDTH="15%"><B><A HREF="MatchResult.html"><I>MatchResult</I></A></B></TD> |
| 63 |
<TD> </TD> |
| 64 |
</TR> |
| 65 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 66 |
<TD WIDTH="15%"><B><A HREF="REFlags.html"><I>REFlags</I></A></B></TD> |
| 67 |
<TD> </TD> |
| 68 |
</TR> |
| 69 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 70 |
<TD WIDTH="15%"><B><A HREF="Substitution.html"><I>Substitution</I></A></B></TD> |
| 71 |
<TD> </TD> |
| 72 |
</TR> |
| 73 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 74 |
<TD WIDTH="15%"><B><A HREF="TextBuffer.html"><I>TextBuffer</I></A></B></TD> |
| 75 |
<TD> </TD> |
| 76 |
</TR> |
| 77 |
</TABLE> |
| 78 |
|
| 79 |
|
| 80 |
<P> |
| 81 |
|
| 82 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 83 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 84 |
<TD COLSPAN=2><FONT SIZE="+2"> |
| 85 |
<B>Class Summary</B></FONT></TD> |
| 86 |
</TR> |
| 87 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 88 |
<TD WIDTH="15%"><B><A HREF="Matcher.html">Matcher</A></B></TD> |
| 89 |
<TD>Matcher instance is an automaton that actually performs matching. </TD> |
| 90 |
</TR> |
| 91 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 92 |
<TD WIDTH="15%"><B><A HREF="Optimizer.html">Optimizer</A></B></TD> |
| 93 |
<TD> </TD> |
| 94 |
</TR> |
| 95 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 96 |
<TD WIDTH="15%"><B><A HREF="Pattern.html">Pattern</A></B></TD> |
| 97 |
<TD>A handle for a precompiled regular expression.<br> |
| 98 |
To match a regular expression <code>myExpr</code> against a text <code>myString</code> one should first create a Pattern object: |
| 99 |
Pattern p=new Pattern(myExpr); |
| 100 |
|
| 101 |
then obtain a Matcher object: |
| 102 |
Matcher matcher=p.matcher(myText); |
| 103 |
|
| 104 |
The latter is an automaton that actually performs a search. </TD> |
| 105 |
</TR> |
| 106 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 107 |
<TD WIDTH="15%"><B><A HREF="PerlSubstitution.html">PerlSubstitution</A></B></TD> |
| 108 |
<TD>An implementation of the Substitution interface. </TD> |
| 109 |
</TR> |
| 110 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 111 |
<TD WIDTH="15%"><B><A HREF="Replacer.html">Replacer</A></B></TD> |
| 112 |
<TD><b>The Replacer class</b> suggests some methods to replace occurences of a pattern |
| 113 |
either by a result of evaluation of a perl-like expression, or by a plain string, |
| 114 |
or according to a custom substitution model, provided as a Substitution interface implementation.<br> |
| 115 |
A Replacer instance may be obtained either using Pattern.replacer(...) method, or by constructor: |
| 116 |
Pattern p=new Pattern("\\w+"); |
| 117 |
Replacer perlExpressionReplacer=p.replacer("[$&]"); |
| 118 |
//or another way to do the same |
| 119 |
Substitution myOwnModel=new Substitution(){ |
| 120 |
public void appendSubstitution(MatchResult match,TextBuffer tb){ |
| 121 |
tb.append('['); |
| 122 |
match.getGroup(MatchResult.MATCH,tb); |
| 123 |
tb.append(']'); |
| 124 |
} |
| 125 |
} |
| 126 |
Replacer myVeryOwnReplacer=new Replacer(p,myOwnModel); |
| 127 |
|
| 128 |
The second method is much more verbose, but gives more freedom. |
| 129 |
</TD> |
| 130 |
</TR> |
| 131 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 132 |
<TD WIDTH="15%"><B><A HREF="RETokenizer.html">RETokenizer</A></B></TD> |
| 133 |
<TD>The Tokenizer class suggests a methods to break a text into tokens using |
| 134 |
occurences of a pattern as delimiters. |
| 135 |
</TD> |
| 136 |
</TR> |
| 137 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 138 |
<TD WIDTH="15%"><B><A HREF="WildcardPattern.html">WildcardPattern</A></B></TD> |
| 139 |
<TD>A Pattern subclass that accepts a simplified pattern syntax: |
| 140 |
<code>?</TD> |
| 141 |
</TR> |
| 142 |
</TABLE> |
| 143 |
|
| 144 |
|
| 145 |
<P> |
| 146 |
|
| 147 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 148 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 149 |
<TD COLSPAN=2><FONT SIZE="+2"> |
| 150 |
<B>Exception Summary</B></FONT></TD> |
| 151 |
</TR> |
| 152 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 153 |
<TD WIDTH="15%"><B><A HREF="PatternSyntaxException.html">PatternSyntaxException</A></B></TD> |
| 154 |
<TD>Is thrown when Pattern constructor's argument doesn't conform the Perl5 regular expression syntax.</TD> |
| 155 |
</TR> |
| 156 |
</TABLE> |
| 157 |
|
| 158 |
|
| 159 |
<P> |
| 160 |
<HR> |
| 161 |
|
| 162 |
<!-- ========== START OF NAVBAR ========== --> |
| 163 |
<A NAME="navbar_bottom"><!-- --></A> |
| 164 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| 165 |
<TR> |
| 166 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 167 |
<A NAME="navbar_bottom_firstrow"><!-- --></A> |
| 168 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| 169 |
<TR ALIGN="center" VALIGN="top"> |
| 170 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 171 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> |
| 172 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> |
| 173 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 174 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 175 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 176 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 177 |
</TR> |
| 178 |
</TABLE> |
| 179 |
</TD> |
| 180 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 181 |
</EM> |
| 182 |
</TD> |
| 183 |
</TR> |
| 184 |
|
| 185 |
<TR> |
| 186 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 187 |
PREV PACKAGE |
| 188 |
<A HREF="../jregex/util/io/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> |
| 189 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 190 |
<A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A> |
| 191 |
<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| 192 |
</TR> |
| 193 |
</TABLE> |
| 194 |
<!-- =========== END OF NAVBAR =========== --> |
| 195 |
|
| 196 |
<HR> |
| 197 |
|
| 198 |
</BODY> |
| 199 |
</HTML> |