| 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:42 GMT+04:00 2002 --> |
| 6 |
<TITLE> |
| 7 |
: Class PerlSubstitution |
| 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="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 23 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></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 |
<A HREF="../jregex/Pattern.html"><B>PREV CLASS</B></A> |
| 39 |
<A HREF="../jregex/Replacer.html"><B>NEXT CLASS</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="PerlSubstitution.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| 43 |
</TR> |
| 44 |
<TR> |
| 45 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 46 |
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 47 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 48 |
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 49 |
</TR> |
| 50 |
</TABLE> |
| 51 |
<!-- =========== END OF NAVBAR =========== --> |
| 52 |
|
| 53 |
<HR> |
| 54 |
<!-- ======== START OF CLASS DATA ======== --> |
| 55 |
<H2> |
| 56 |
<FONT SIZE="-1"> |
| 57 |
jregex</FONT> |
| 58 |
<BR> |
| 59 |
Class PerlSubstitution</H2> |
| 60 |
<PRE> |
| 61 |
java.lang.Object |
| 62 |
| |
| 63 |
+--<B>jregex.PerlSubstitution</B> |
| 64 |
</PRE> |
| 65 |
<DL> |
| 66 |
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../jregex/Substitution.html">Substitution</A></DD> |
| 67 |
</DL> |
| 68 |
<HR> |
| 69 |
<DL> |
| 70 |
<DT>public class <B>PerlSubstitution</B><DT>extends java.lang.Object<DT>implements <A HREF="../jregex/Substitution.html">Substitution</A></DL> |
| 71 |
|
| 72 |
<P> |
| 73 |
An implementation of the Substitution interface. Performs substitutions in accordance with Perl-like substitution scripts.<br> |
| 74 |
The latter is a string, containing a mix of memory register references and plain text blocks.<br> |
| 75 |
It may look like "some_chars $1 some_chars$2some_chars" or "123${1}45${2}67".<br> |
| 76 |
A tag consisting of '$',not preceeded by the escape character'\' and followed by some digits (possibly enclosed in the curled brackets) is interpreted as a memory register reference, the digits forming a register ID. |
| 77 |
All the rest is considered as a plain text.<br> |
| 78 |
Upon the Replacer has found a text block that matches the pattern, a references in a replacement string are replaced by the contents of |
| 79 |
corresponding memory registers, and the resulting text replaces the matched block.<br> |
| 80 |
For example, the following code: |
| 81 |
<pre> |
| 82 |
System.out.println("\""+ |
| 83 |
new Replacer(new Pattern("\\b(\\d+)\\b"),new PerlSubstitution("'$1'")).replace("abc 123 def") |
| 84 |
+"\""); |
| 85 |
</pre> |
| 86 |
will print <code>"abc '123' def"</code>.<br> |
| 87 |
<P> |
| 88 |
<DL> |
| 89 |
<DT><B>See Also: </B><DD><A HREF="../jregex/Substitution.html"><CODE>Substitution</CODE></A>, |
| 90 |
<A HREF="../jregex/Replacer.html"><CODE>Replacer</CODE></A>, |
| 91 |
<A HREF="../jregex/Pattern.html"><CODE>Pattern</CODE></A></DL> |
| 92 |
<HR> |
| 93 |
|
| 94 |
<P> |
| 95 |
<!-- ======== INNER CLASS SUMMARY ======== --> |
| 96 |
|
| 97 |
|
| 98 |
<!-- =========== FIELD SUMMARY =========== --> |
| 99 |
|
| 100 |
|
| 101 |
<!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| 102 |
|
| 103 |
<A NAME="constructor_summary"><!-- --></A> |
| 104 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 105 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 106 |
<TD COLSPAN=2><FONT SIZE="+2"> |
| 107 |
<B>Constructor Summary</B></FONT></TD> |
| 108 |
</TR> |
| 109 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 110 |
<TD><CODE><B><A HREF="../jregex/PerlSubstitution.html#PerlSubstitution(java.lang.String)">PerlSubstitution</A></B>(java.lang.String s)</CODE> |
| 111 |
|
| 112 |
<BR> |
| 113 |
</TD> |
| 114 |
</TR> |
| 115 |
</TABLE> |
| 116 |
|
| 117 |
<!-- ========== METHOD SUMMARY =========== --> |
| 118 |
|
| 119 |
<A NAME="method_summary"><!-- --></A> |
| 120 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 121 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 122 |
<TD COLSPAN=2><FONT SIZE="+2"> |
| 123 |
<B>Method Summary</B></FONT></TD> |
| 124 |
</TR> |
| 125 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 126 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 127 |
<CODE> void</CODE></FONT></TD> |
| 128 |
<TD><CODE><B><A HREF="../jregex/PerlSubstitution.html#appendSubstitution(jregex.MatchResult, jregex.TextBuffer)">appendSubstitution</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A> match, |
| 129 |
<A HREF="../jregex/TextBuffer.html">TextBuffer</A> dest)</CODE> |
| 130 |
|
| 131 |
<BR> |
| 132 |
</TD> |
| 133 |
</TR> |
| 134 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 135 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 136 |
<CODE> java.lang.String</CODE></FONT></TD> |
| 137 |
<TD><CODE><B><A HREF="../jregex/PerlSubstitution.html#toString()">toString</A></B>()</CODE> |
| 138 |
|
| 139 |
<BR> |
| 140 |
</TD> |
| 141 |
</TR> |
| 142 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 143 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 144 |
<CODE> java.lang.String</CODE></FONT></TD> |
| 145 |
<TD><CODE><B><A HREF="../jregex/PerlSubstitution.html#value(jregex.MatchResult)">value</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A> mr)</CODE> |
| 146 |
|
| 147 |
<BR> |
| 148 |
</TD> |
| 149 |
</TR> |
| 150 |
</TABLE> |
| 151 |
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| 152 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 153 |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| 154 |
<TD><B>Methods inherited from class java.lang.Object</B></TD> |
| 155 |
</TR> |
| 156 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 157 |
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> |
| 158 |
</TR> |
| 159 |
</TABLE> |
| 160 |
|
| 161 |
<P> |
| 162 |
|
| 163 |
<!-- ============ FIELD DETAIL =========== --> |
| 164 |
|
| 165 |
|
| 166 |
<!-- ========= CONSTRUCTOR DETAIL ======== --> |
| 167 |
|
| 168 |
<A NAME="constructor_detail"><!-- --></A> |
| 169 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 170 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 171 |
<TD COLSPAN=1><FONT SIZE="+2"> |
| 172 |
<B>Constructor Detail</B></FONT></TD> |
| 173 |
</TR> |
| 174 |
</TABLE> |
| 175 |
|
| 176 |
<A NAME="PerlSubstitution(java.lang.String)"><!-- --></A><H3> |
| 177 |
PerlSubstitution</H3> |
| 178 |
<PRE> |
| 179 |
public <B>PerlSubstitution</B>(java.lang.String s)</PRE> |
| 180 |
<DL> |
| 181 |
</DL> |
| 182 |
|
| 183 |
<!-- ============ METHOD DETAIL ========== --> |
| 184 |
|
| 185 |
<A NAME="method_detail"><!-- --></A> |
| 186 |
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> |
| 187 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 188 |
<TD COLSPAN=1><FONT SIZE="+2"> |
| 189 |
<B>Method Detail</B></FONT></TD> |
| 190 |
</TR> |
| 191 |
</TABLE> |
| 192 |
|
| 193 |
<A NAME="value(jregex.MatchResult)"><!-- --></A><H3> |
| 194 |
value</H3> |
| 195 |
<PRE> |
| 196 |
public java.lang.String <B>value</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A> mr)</PRE> |
| 197 |
<DL> |
| 198 |
<DD><DL> |
| 199 |
</DL> |
| 200 |
</DD> |
| 201 |
</DL> |
| 202 |
<HR> |
| 203 |
|
| 204 |
<A NAME="appendSubstitution(jregex.MatchResult, jregex.TextBuffer)"><!-- --></A><H3> |
| 205 |
appendSubstitution</H3> |
| 206 |
<PRE> |
| 207 |
public void <B>appendSubstitution</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A> match, |
| 208 |
<A HREF="../jregex/TextBuffer.html">TextBuffer</A> dest)</PRE> |
| 209 |
<DL> |
| 210 |
<DD><DL> |
| 211 |
<DT><B>Specified by: </B><DD><CODE><A HREF="../jregex/Substitution.html#appendSubstitution(jregex.MatchResult, jregex.TextBuffer)">appendSubstitution</A></CODE> in interface <CODE><A HREF="../jregex/Substitution.html">Substitution</A></CODE></DL> |
| 212 |
</DD> |
| 213 |
</DL> |
| 214 |
<HR> |
| 215 |
|
| 216 |
<A NAME="toString()"><!-- --></A><H3> |
| 217 |
toString</H3> |
| 218 |
<PRE> |
| 219 |
public java.lang.String <B>toString</B>()</PRE> |
| 220 |
<DL> |
| 221 |
<DD><DL> |
| 222 |
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> |
| 223 |
</DD> |
| 224 |
</DL> |
| 225 |
<!-- ========= END OF CLASS DATA ========= --> |
| 226 |
<HR> |
| 227 |
|
| 228 |
<!-- ========== START OF NAVBAR ========== --> |
| 229 |
<A NAME="navbar_bottom"><!-- --></A> |
| 230 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> |
| 231 |
<TR> |
| 232 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 233 |
<A NAME="navbar_bottom_firstrow"><!-- --></A> |
| 234 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> |
| 235 |
<TR ALIGN="center" VALIGN="top"> |
| 236 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 237 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 238 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 239 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 240 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 241 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 242 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 243 |
</TR> |
| 244 |
</TABLE> |
| 245 |
</TD> |
| 246 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 247 |
</EM> |
| 248 |
</TD> |
| 249 |
</TR> |
| 250 |
|
| 251 |
<TR> |
| 252 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 253 |
<A HREF="../jregex/Pattern.html"><B>PREV CLASS</B></A> |
| 254 |
<A HREF="../jregex/Replacer.html"><B>NEXT CLASS</B></A></FONT></TD> |
| 255 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 256 |
<A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A> |
| 257 |
<A HREF="PerlSubstitution.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> |
| 258 |
</TR> |
| 259 |
<TR> |
| 260 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 261 |
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 262 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 263 |
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 264 |
</TR> |
| 265 |
</TABLE> |
| 266 |
<!-- =========== END OF NAVBAR =========== --> |
| 267 |
|
| 268 |
<HR> |
| 269 |
|
| 270 |
</BODY> |
| 271 |
</HTML> |