Debian Codegraph @

docs/api/jregex/Replacer.html

raw
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 Replacer
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>&nbsp;</TD>
22 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
23 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
24 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
25 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
26 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
27 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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 &nbsp;<A HREF="../jregex/PerlSubstitution.html"><B>PREV CLASS</B></A>&nbsp;
39 &nbsp;<A HREF="../jregex/RETokenizer.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> &nbsp;
42 &nbsp;<A HREF="Replacer.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: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
47 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
48 DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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 Replacer</H2>
60 <PRE>
61 java.lang.Object
62 |
63 +--<B>jregex.Replacer</B>
64 </PRE>
65 <HR>
66 <DL>
67 <DT>public class <B>Replacer</B><DT>extends java.lang.Object</DL>
68
69 <P>
70 <b>The Replacer class</b> suggests some methods to replace occurences of a pattern
71 either by a result of evaluation of a perl-like expression, or by a plain string,
72 or according to a custom substitution model, provided as a Substitution interface implementation.<br>
73 A Replacer instance may be obtained either using Pattern.replacer(...) method, or by constructor:<pre>
74 Pattern p=new Pattern("\\w+");
75 Replacer perlExpressionReplacer=p.replacer("[$&]");
76 //or another way to do the same
77 Substitution myOwnModel=new Substitution(){
78 public void appendSubstitution(MatchResult match,TextBuffer tb){
79 tb.append('[');
80 match.getGroup(MatchResult.MATCH,tb);
81 tb.append(']');
82 }
83 }
84 Replacer myVeryOwnReplacer=new Replacer(p,myOwnModel);
85 </pre>
86 The second method is much more verbose, but gives more freedom.
87 To perform a replacement call replace(someInput):<pre>
88 System.out.print(perlExpressionReplacer.replace("All your base "));
89 System.out.println(myVeryOwnReplacer.replace("are belong to us"));
90 //result: "[All] [your] [base] [are] [belong] [to] [us]"
91 </pre>
92 <P>
93 <DL>
94 <DT><B>See Also: </B><DD><A HREF="../jregex/Substitution.html"><CODE>Substitution</CODE></A>,
95 <A HREF="../jregex/PerlSubstitution.html"><CODE>PerlSubstitution</CODE></A>,
96 <A HREF="../jregex/Replacer.html#Replacer(jregex.Pattern, jregex.Substitution)"><CODE>Replacer(jregex.Pattern,jregex.Substitution)</CODE></A></DL>
97 <HR>
98
99 <P>
100 <!-- ======== INNER CLASS SUMMARY ======== -->
101
102
103 <!-- =========== FIELD SUMMARY =========== -->
104
105
106 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
107
108 <A NAME="constructor_summary"><!-- --></A>
109 <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
110 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
111 <TD COLSPAN=2><FONT SIZE="+2">
112 <B>Constructor Summary</B></FONT></TD>
113 </TR>
114 <TR BGCOLOR="white" CLASS="TableRowColor">
115 <TD><CODE><B><A HREF="../jregex/Replacer.html#Replacer(jregex.Pattern, java.lang.String)">Replacer</A></B>(<A HREF="../jregex/Pattern.html">Pattern</A>&nbsp;pattern,
116 java.lang.String&nbsp;substitution)</CODE>
117
118 <BR>
119 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
120 </TR>
121 <TR BGCOLOR="white" CLASS="TableRowColor">
122 <TD><CODE><B><A HREF="../jregex/Replacer.html#Replacer(jregex.Pattern, java.lang.String, boolean)">Replacer</A></B>(<A HREF="../jregex/Pattern.html">Pattern</A>&nbsp;pattern,
123 java.lang.String&nbsp;substitution,
124 boolean&nbsp;isPerlExpr)</CODE>
125
126 <BR>
127 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
128 </TR>
129 <TR BGCOLOR="white" CLASS="TableRowColor">
130 <TD><CODE><B><A HREF="../jregex/Replacer.html#Replacer(jregex.Pattern, jregex.Substitution)">Replacer</A></B>(<A HREF="../jregex/Pattern.html">Pattern</A>&nbsp;pattern,
131 <A HREF="../jregex/Substitution.html">Substitution</A>&nbsp;substitution)</CODE>
132
133 <BR>
134 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
135 </TR>
136 </TABLE>
137 &nbsp;
138 <!-- ========== METHOD SUMMARY =========== -->
139
140 <A NAME="method_summary"><!-- --></A>
141 <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
142 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
143 <TD COLSPAN=2><FONT SIZE="+2">
144 <B>Method Summary</B></FONT></TD>
145 </TR>
146 <TR BGCOLOR="white" CLASS="TableRowColor">
147 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
148 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
149 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(char[], int, int)">replace</A></B>(char[]&nbsp;chars,
150 int&nbsp;off,
151 int&nbsp;len)</CODE>
152
153 <BR>
154 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
155 </TR>
156 <TR BGCOLOR="white" CLASS="TableRowColor">
157 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
158 <CODE>&nbsp;int</CODE></FONT></TD>
159 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(char[], int, int, java.lang.StringBuffer)">replace</A></B>(char[]&nbsp;chars,
160 int&nbsp;off,
161 int&nbsp;len,
162 java.lang.StringBuffer&nbsp;sb)</CODE>
163
164 <BR>
165 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
166 </TR>
167 <TR BGCOLOR="white" CLASS="TableRowColor">
168 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
169 <CODE>&nbsp;int</CODE></FONT></TD>
170 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(char[], int, int, jregex.TextBuffer)">replace</A></B>(char[]&nbsp;chars,
171 int&nbsp;off,
172 int&nbsp;len,
173 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</CODE>
174
175 <BR>
176 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
177 </TR>
178 <TR BGCOLOR="white" CLASS="TableRowColor">
179 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
180 <CODE>&nbsp;void</CODE></FONT></TD>
181 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(char[], int, int, java.io.Writer)">replace</A></B>(char[]&nbsp;chars,
182 int&nbsp;off,
183 int&nbsp;len,
184 java.io.Writer&nbsp;out)</CODE>
185
186 <BR>
187 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
188 </TR>
189 <TR BGCOLOR="white" CLASS="TableRowColor">
190 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
191 <CODE>static&nbsp;int</CODE></FONT></TD>
192 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.Matcher, jregex.Substitution, jregex.TextBuffer)">replace</A></B>(<A HREF="../jregex/Matcher.html">Matcher</A>&nbsp;m,
193 <A HREF="../jregex/Substitution.html">Substitution</A>&nbsp;substitution,
194 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</CODE>
195
196 <BR>
197 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces all occurences of a matcher's pattern in a matcher's target
198 by a given substitution appending the result to a buffer.<br>
199 The substitution starts from current matcher's position, current match
200 not included.</TD>
201 </TR>
202 <TR BGCOLOR="white" CLASS="TableRowColor">
203 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
204 <CODE>static&nbsp;int</CODE></FONT></TD>
205 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.Matcher, jregex.Substitution, java.io.Writer)">replace</A></B>(<A HREF="../jregex/Matcher.html">Matcher</A>&nbsp;m,
206 <A HREF="../jregex/Substitution.html">Substitution</A>&nbsp;substitution,
207 java.io.Writer&nbsp;out)</CODE>
208
209 <BR>
210 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
211 </TR>
212 <TR BGCOLOR="white" CLASS="TableRowColor">
213 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
214 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
215 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, int)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
216 int&nbsp;group)</CODE>
217
218 <BR>
219 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
220 </TR>
221 <TR BGCOLOR="white" CLASS="TableRowColor">
222 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
223 <CODE>&nbsp;int</CODE></FONT></TD>
224 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, int, java.lang.StringBuffer)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
225 int&nbsp;group,
226 java.lang.StringBuffer&nbsp;sb)</CODE>
227
228 <BR>
229 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
230 </TR>
231 <TR BGCOLOR="white" CLASS="TableRowColor">
232 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
233 <CODE>&nbsp;int</CODE></FONT></TD>
234 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, int, jregex.TextBuffer)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
235 int&nbsp;group,
236 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</CODE>
237
238 <BR>
239 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
240 </TR>
241 <TR BGCOLOR="white" CLASS="TableRowColor">
242 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
243 <CODE>&nbsp;void</CODE></FONT></TD>
244 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, int, java.io.Writer)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
245 int&nbsp;group,
246 java.io.Writer&nbsp;out)</CODE>
247
248 <BR>
249 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
250 </TR>
251 <TR BGCOLOR="white" CLASS="TableRowColor">
252 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
253 <CODE>&nbsp;int</CODE></FONT></TD>
254 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, java.lang.String, java.lang.StringBuffer)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
255 java.lang.String&nbsp;groupName,
256 java.lang.StringBuffer&nbsp;sb)</CODE>
257
258 <BR>
259 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
260 </TR>
261 <TR BGCOLOR="white" CLASS="TableRowColor">
262 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
263 <CODE>&nbsp;int</CODE></FONT></TD>
264 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, java.lang.String, jregex.TextBuffer)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
265 java.lang.String&nbsp;groupName,
266 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</CODE>
267
268 <BR>
269 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
270 </TR>
271 <TR BGCOLOR="white" CLASS="TableRowColor">
272 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
273 <CODE>&nbsp;void</CODE></FONT></TD>
274 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(jregex.MatchResult, java.lang.String, java.io.Writer)">replace</A></B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
275 java.lang.String&nbsp;groupName,
276 java.io.Writer&nbsp;out)</CODE>
277
278 <BR>
279 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
280 </TR>
281 <TR BGCOLOR="white" CLASS="TableRowColor">
282 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
283 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
284 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.io.Reader, int)">replace</A></B>(java.io.Reader&nbsp;text,
285 int&nbsp;length)</CODE>
286
287 <BR>
288 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
289 </TR>
290 <TR BGCOLOR="white" CLASS="TableRowColor">
291 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
292 <CODE>&nbsp;int</CODE></FONT></TD>
293 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.io.Reader, int, java.lang.StringBuffer)">replace</A></B>(java.io.Reader&nbsp;text,
294 int&nbsp;length,
295 java.lang.StringBuffer&nbsp;sb)</CODE>
296
297 <BR>
298 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
299 </TR>
300 <TR BGCOLOR="white" CLASS="TableRowColor">
301 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
302 <CODE>&nbsp;int</CODE></FONT></TD>
303 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.io.Reader, int, jregex.TextBuffer)">replace</A></B>(java.io.Reader&nbsp;text,
304 int&nbsp;length,
305 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</CODE>
306
307 <BR>
308 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
309 </TR>
310 <TR BGCOLOR="white" CLASS="TableRowColor">
311 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
312 <CODE>&nbsp;void</CODE></FONT></TD>
313 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.io.Reader, int, java.io.Writer)">replace</A></B>(java.io.Reader&nbsp;in,
314 int&nbsp;length,
315 java.io.Writer&nbsp;out)</CODE>
316
317 <BR>
318 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
319 </TR>
320 <TR BGCOLOR="white" CLASS="TableRowColor">
321 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
322 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
323 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.lang.String)">replace</A></B>(java.lang.String&nbsp;text)</CODE>
324
325 <BR>
326 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
327 </TR>
328 <TR BGCOLOR="white" CLASS="TableRowColor">
329 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
330 <CODE>&nbsp;int</CODE></FONT></TD>
331 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.lang.String, java.lang.StringBuffer)">replace</A></B>(java.lang.String&nbsp;text,
332 java.lang.StringBuffer&nbsp;sb)</CODE>
333
334 <BR>
335 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
336 </TR>
337 <TR BGCOLOR="white" CLASS="TableRowColor">
338 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
339 <CODE>&nbsp;int</CODE></FONT></TD>
340 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.lang.String, jregex.TextBuffer)">replace</A></B>(java.lang.String&nbsp;text,
341 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</CODE>
342
343 <BR>
344 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
345 </TR>
346 <TR BGCOLOR="white" CLASS="TableRowColor">
347 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
348 <CODE>&nbsp;void</CODE></FONT></TD>
349 <TD><CODE><B><A HREF="../jregex/Replacer.html#replace(java.lang.String, java.io.Writer)">replace</A></B>(java.lang.String&nbsp;text,
350 java.io.Writer&nbsp;out)</CODE>
351
352 <BR>
353 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
354 </TR>
355 <TR BGCOLOR="white" CLASS="TableRowColor">
356 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
357 <CODE>&nbsp;void</CODE></FONT></TD>
358 <TD><CODE><B><A HREF="../jregex/Replacer.html#setSubstitution(java.lang.String, boolean)">setSubstitution</A></B>(java.lang.String&nbsp;s,
359 boolean&nbsp;isPerlExpr)</CODE>
360
361 <BR>
362 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
363 </TR>
364 <TR BGCOLOR="white" CLASS="TableRowColor">
365 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
366 <CODE>static&nbsp;<A HREF="../jregex/TextBuffer.html">TextBuffer</A></CODE></FONT></TD>
367 <TD><CODE><B><A HREF="../jregex/Replacer.html#wrap(java.lang.StringBuffer)">wrap</A></B>(java.lang.StringBuffer&nbsp;sb)</CODE>
368
369 <BR>
370 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
371 </TR>
372 <TR BGCOLOR="white" CLASS="TableRowColor">
373 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
374 <CODE>static&nbsp;<A HREF="../jregex/TextBuffer.html">TextBuffer</A></CODE></FONT></TD>
375 <TD><CODE><B><A HREF="../jregex/Replacer.html#wrap(java.io.Writer)">wrap</A></B>(java.io.Writer&nbsp;writer)</CODE>
376
377 <BR>
378 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
379 </TR>
380 </TABLE>
381 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
382 <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
383 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
384 <TD><B>Methods inherited from class java.lang.Object</B></TD>
385 </TR>
386 <TR BGCOLOR="white" CLASS="TableRowColor">
387 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
388 </TR>
389 </TABLE>
390 &nbsp;
391 <P>
392
393 <!-- ============ FIELD DETAIL =========== -->
394
395
396 <!-- ========= CONSTRUCTOR DETAIL ======== -->
397
398 <A NAME="constructor_detail"><!-- --></A>
399 <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
400 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
401 <TD COLSPAN=1><FONT SIZE="+2">
402 <B>Constructor Detail</B></FONT></TD>
403 </TR>
404 </TABLE>
405
406 <A NAME="Replacer(jregex.Pattern, jregex.Substitution)"><!-- --></A><H3>
407 Replacer</H3>
408 <PRE>
409 public <B>Replacer</B>(<A HREF="../jregex/Pattern.html">Pattern</A>&nbsp;pattern,
410 <A HREF="../jregex/Substitution.html">Substitution</A>&nbsp;substitution)</PRE>
411 <DL>
412 </DL>
413 <HR>
414
415 <A NAME="Replacer(jregex.Pattern, java.lang.String)"><!-- --></A><H3>
416 Replacer</H3>
417 <PRE>
418 public <B>Replacer</B>(<A HREF="../jregex/Pattern.html">Pattern</A>&nbsp;pattern,
419 java.lang.String&nbsp;substitution)</PRE>
420 <DL>
421 </DL>
422 <HR>
423
424 <A NAME="Replacer(jregex.Pattern, java.lang.String, boolean)"><!-- --></A><H3>
425 Replacer</H3>
426 <PRE>
427 public <B>Replacer</B>(<A HREF="../jregex/Pattern.html">Pattern</A>&nbsp;pattern,
428 java.lang.String&nbsp;substitution,
429 boolean&nbsp;isPerlExpr)</PRE>
430 <DL>
431 </DL>
432
433 <!-- ============ METHOD DETAIL ========== -->
434
435 <A NAME="method_detail"><!-- --></A>
436 <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
437 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
438 <TD COLSPAN=1><FONT SIZE="+2">
439 <B>Method Detail</B></FONT></TD>
440 </TR>
441 </TABLE>
442
443 <A NAME="setSubstitution(java.lang.String, boolean)"><!-- --></A><H3>
444 setSubstitution</H3>
445 <PRE>
446 public void <B>setSubstitution</B>(java.lang.String&nbsp;s,
447 boolean&nbsp;isPerlExpr)</PRE>
448 <DL>
449 </DL>
450 <HR>
451
452 <A NAME="replace(java.lang.String)"><!-- --></A><H3>
453 replace</H3>
454 <PRE>
455 public java.lang.String <B>replace</B>(java.lang.String&nbsp;text)</PRE>
456 <DL>
457 </DL>
458 <HR>
459
460 <A NAME="replace(char[], int, int)"><!-- --></A><H3>
461 replace</H3>
462 <PRE>
463 public java.lang.String <B>replace</B>(char[]&nbsp;chars,
464 int&nbsp;off,
465 int&nbsp;len)</PRE>
466 <DL>
467 </DL>
468 <HR>
469
470 <A NAME="replace(jregex.MatchResult, int)"><!-- --></A><H3>
471 replace</H3>
472 <PRE>
473 public java.lang.String <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
474 int&nbsp;group)</PRE>
475 <DL>
476 </DL>
477 <HR>
478
479 <A NAME="replace(java.io.Reader, int)"><!-- --></A><H3>
480 replace</H3>
481 <PRE>
482 public java.lang.String <B>replace</B>(java.io.Reader&nbsp;text,
483 int&nbsp;length)
484 throws java.io.IOException</PRE>
485 <DL>
486 </DL>
487 <HR>
488
489 <A NAME="replace(java.lang.String, java.lang.StringBuffer)"><!-- --></A><H3>
490 replace</H3>
491 <PRE>
492 public int <B>replace</B>(java.lang.String&nbsp;text,
493 java.lang.StringBuffer&nbsp;sb)</PRE>
494 <DL>
495 </DL>
496 <HR>
497
498 <A NAME="replace(char[], int, int, java.lang.StringBuffer)"><!-- --></A><H3>
499 replace</H3>
500 <PRE>
501 public int <B>replace</B>(char[]&nbsp;chars,
502 int&nbsp;off,
503 int&nbsp;len,
504 java.lang.StringBuffer&nbsp;sb)</PRE>
505 <DL>
506 </DL>
507 <HR>
508
509 <A NAME="replace(jregex.MatchResult, int, java.lang.StringBuffer)"><!-- --></A><H3>
510 replace</H3>
511 <PRE>
512 public int <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
513 int&nbsp;group,
514 java.lang.StringBuffer&nbsp;sb)</PRE>
515 <DL>
516 </DL>
517 <HR>
518
519 <A NAME="replace(jregex.MatchResult, java.lang.String, java.lang.StringBuffer)"><!-- --></A><H3>
520 replace</H3>
521 <PRE>
522 public int <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
523 java.lang.String&nbsp;groupName,
524 java.lang.StringBuffer&nbsp;sb)</PRE>
525 <DL>
526 </DL>
527 <HR>
528
529 <A NAME="replace(java.io.Reader, int, java.lang.StringBuffer)"><!-- --></A><H3>
530 replace</H3>
531 <PRE>
532 public int <B>replace</B>(java.io.Reader&nbsp;text,
533 int&nbsp;length,
534 java.lang.StringBuffer&nbsp;sb)
535 throws java.io.IOException</PRE>
536 <DL>
537 </DL>
538 <HR>
539
540 <A NAME="replace(java.lang.String, jregex.TextBuffer)"><!-- --></A><H3>
541 replace</H3>
542 <PRE>
543 public int <B>replace</B>(java.lang.String&nbsp;text,
544 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</PRE>
545 <DL>
546 </DL>
547 <HR>
548
549 <A NAME="replace(char[], int, int, jregex.TextBuffer)"><!-- --></A><H3>
550 replace</H3>
551 <PRE>
552 public int <B>replace</B>(char[]&nbsp;chars,
553 int&nbsp;off,
554 int&nbsp;len,
555 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</PRE>
556 <DL>
557 </DL>
558 <HR>
559
560 <A NAME="replace(jregex.MatchResult, int, jregex.TextBuffer)"><!-- --></A><H3>
561 replace</H3>
562 <PRE>
563 public int <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
564 int&nbsp;group,
565 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</PRE>
566 <DL>
567 </DL>
568 <HR>
569
570 <A NAME="replace(jregex.MatchResult, java.lang.String, jregex.TextBuffer)"><!-- --></A><H3>
571 replace</H3>
572 <PRE>
573 public int <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
574 java.lang.String&nbsp;groupName,
575 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</PRE>
576 <DL>
577 </DL>
578 <HR>
579
580 <A NAME="replace(java.io.Reader, int, jregex.TextBuffer)"><!-- --></A><H3>
581 replace</H3>
582 <PRE>
583 public int <B>replace</B>(java.io.Reader&nbsp;text,
584 int&nbsp;length,
585 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)
586 throws java.io.IOException</PRE>
587 <DL>
588 </DL>
589 <HR>
590
591 <A NAME="replace(jregex.Matcher, jregex.Substitution, jregex.TextBuffer)"><!-- --></A><H3>
592 replace</H3>
593 <PRE>
594 public static int <B>replace</B>(<A HREF="../jregex/Matcher.html">Matcher</A>&nbsp;m,
595 <A HREF="../jregex/Substitution.html">Substitution</A>&nbsp;substitution,
596 <A HREF="../jregex/TextBuffer.html">TextBuffer</A>&nbsp;dest)</PRE>
597 <DL>
598 <DD>Replaces all occurences of a matcher's pattern in a matcher's target
599 by a given substitution appending the result to a buffer.<br>
600 The substitution starts from current matcher's position, current match
601 not included.</DL>
602 <HR>
603
604 <A NAME="replace(jregex.Matcher, jregex.Substitution, java.io.Writer)"><!-- --></A><H3>
605 replace</H3>
606 <PRE>
607 public static int <B>replace</B>(<A HREF="../jregex/Matcher.html">Matcher</A>&nbsp;m,
608 <A HREF="../jregex/Substitution.html">Substitution</A>&nbsp;substitution,
609 java.io.Writer&nbsp;out)
610 throws java.io.IOException</PRE>
611 <DL>
612 </DL>
613 <HR>
614
615 <A NAME="replace(java.lang.String, java.io.Writer)"><!-- --></A><H3>
616 replace</H3>
617 <PRE>
618 public void <B>replace</B>(java.lang.String&nbsp;text,
619 java.io.Writer&nbsp;out)
620 throws java.io.IOException</PRE>
621 <DL>
622 </DL>
623 <HR>
624
625 <A NAME="replace(char[], int, int, java.io.Writer)"><!-- --></A><H3>
626 replace</H3>
627 <PRE>
628 public void <B>replace</B>(char[]&nbsp;chars,
629 int&nbsp;off,
630 int&nbsp;len,
631 java.io.Writer&nbsp;out)
632 throws java.io.IOException</PRE>
633 <DL>
634 </DL>
635 <HR>
636
637 <A NAME="replace(jregex.MatchResult, int, java.io.Writer)"><!-- --></A><H3>
638 replace</H3>
639 <PRE>
640 public void <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
641 int&nbsp;group,
642 java.io.Writer&nbsp;out)
643 throws java.io.IOException</PRE>
644 <DL>
645 </DL>
646 <HR>
647
648 <A NAME="replace(jregex.MatchResult, java.lang.String, java.io.Writer)"><!-- --></A><H3>
649 replace</H3>
650 <PRE>
651 public void <B>replace</B>(<A HREF="../jregex/MatchResult.html">MatchResult</A>&nbsp;res,
652 java.lang.String&nbsp;groupName,
653 java.io.Writer&nbsp;out)
654 throws java.io.IOException</PRE>
655 <DL>
656 </DL>
657 <HR>
658
659 <A NAME="replace(java.io.Reader, int, java.io.Writer)"><!-- --></A><H3>
660 replace</H3>
661 <PRE>
662 public void <B>replace</B>(java.io.Reader&nbsp;in,
663 int&nbsp;length,
664 java.io.Writer&nbsp;out)
665 throws java.io.IOException</PRE>
666 <DL>
667 </DL>
668 <HR>
669
670 <A NAME="wrap(java.lang.StringBuffer)"><!-- --></A><H3>
671 wrap</H3>
672 <PRE>
673 public static <A HREF="../jregex/TextBuffer.html">TextBuffer</A> <B>wrap</B>(java.lang.StringBuffer&nbsp;sb)</PRE>
674 <DL>
675 </DL>
676 <HR>
677
678 <A NAME="wrap(java.io.Writer)"><!-- --></A><H3>
679 wrap</H3>
680 <PRE>
681 public static <A HREF="../jregex/TextBuffer.html">TextBuffer</A> <B>wrap</B>(java.io.Writer&nbsp;writer)</PRE>
682 <DL>
683 </DL>
684 <!-- ========= END OF CLASS DATA ========= -->
685 <HR>
686
687 <!-- ========== START OF NAVBAR ========== -->
688 <A NAME="navbar_bottom"><!-- --></A>
689 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
690 <TR>
691 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
692 <A NAME="navbar_bottom_firstrow"><!-- --></A>
693 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
694 <TR ALIGN="center" VALIGN="top">
695 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
696 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
697 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
698 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
699 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
700 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
701 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
702 </TR>
703 </TABLE>
704 </TD>
705 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
706 </EM>
707 </TD>
708 </TR>
709
710 <TR>
711 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
712 &nbsp;<A HREF="../jregex/PerlSubstitution.html"><B>PREV CLASS</B></A>&nbsp;
713 &nbsp;<A HREF="../jregex/RETokenizer.html"><B>NEXT CLASS</B></A></FONT></TD>
714 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
715 <A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
716 &nbsp;<A HREF="Replacer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
717 </TR>
718 <TR>
719 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
720 SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
721 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
722 DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
723 </TR>
724 </TABLE>
725 <!-- =========== END OF NAVBAR =========== -->
726
727 <HR>
728
729 </BODY>
730 </HTML>