????
| Current Path : /opt/ant/manual/api/org/apache/tools/ant/taskdefs/optional/ |
| Current File : //opt/ant/manual/api/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_03) on Tue May 22 06:24:53 CEST 2012 -->
<title>ReplaceRegExp (Apache Ant API)</title>
<meta name="date" content="2012-05-22">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ReplaceRegExp (Apache Ant API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/Rpm.html" title="class in org.apache.tools.ant.taskdefs.optional"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html" target="_top">Frames</a></li>
<li><a href="ReplaceRegExp.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#fields_inherited_from_class_org.apache.tools.ant.Task">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.tools.ant.taskdefs.optional</div>
<h2 title="Class ReplaceRegExp" class="title">Class ReplaceRegExp</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">org.apache.tools.ant.ProjectComponent</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">org.apache.tools.ant.Task</a></li>
<li>
<ul class="inheritance">
<li>org.apache.tools.ant.taskdefs.optional.ReplaceRegExp</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.lang.Cloneable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">ReplaceRegExp</span>
extends <a href="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a></pre>
<div class="block">Performs regular expression string replacements in a text
file. The input file(s) must be able to be properly processed by
a Reader instance. That is, they must be text only, no binary.
The syntax of the regular expression depends on the implementation that
you choose to use. The system property <code>ant.regexp.regexpimpl</code>
will be the classname of the implementation that will be used (the default
is <code>org.apache.tools.ant.util.regexp.JakartaOroRegexp</code> and
requires the Jakarta Oro Package).
<pre>
Available implementations:
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (default)
Uses Java's built-in regular expression package
org.apache.tools.ant.util.regexp.JakartaOroRegexp
Requires the jakarta-oro package
org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
Requires the jakarta-regexp package
Usage:
Call Syntax:
<replaceregexp file="file"
match="pattern"
replace="pattern"
flags="options"?
byline="true|false"? >
regexp?
substitution?
fileset*
</replaceregexp>
NOTE: You must have either the file attribute specified, or at least one fileset subelement
to operation on. You may not have the file attribute specified if you nest fileset elements
inside this task. Also, you cannot specify both match and a regular expression subelement at
the same time, nor can you specify the replace attribute and the substitution subelement at
the same time.
Attributes:
file --> A single file to operation on (mutually exclusive
with the fileset subelements)
match --> The Regular expression to match
replace --> The Expression replacement string
flags --> The options to give to the replacement
g = Substitute all occurrences. default is to replace only the first one
i = Case insensitive match
byline --> Should this file be processed a single line at a time (default is false)
"true" indicates to perform replacement on a line by line basis
"false" indicates to perform replacement on the whole file at once.
Example:
The following call could be used to replace an old property name in a ".properties"
file with a new name. In the replace attribute, you can refer to any part of the
match expression in parenthesis using backslash followed by a number like '\1'.
<replaceregexp file="test.properties"
match="MyProperty=(.*)"
replace="NewProperty=\1"
byline="true" />
</pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.tools.ant.Task">
<!-- -->
</a>
<h3>Fields inherited from class org.apache.tools.ant.<a href="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a></h3>
<code><a href="../../../../../../org/apache/tools/ant/Task.html#target">target</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#taskName">taskName</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#taskType">taskType</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#wrapper">wrapper</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.tools.ant.ProjectComponent">
<!-- -->
</a>
<h3>Fields inherited from class org.apache.tools.ant.<a href="../../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</a></h3>
<code><a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#description">description</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#location">location</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#project">project</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#ReplaceRegExp()">ReplaceRegExp</a></strong>()</code>
<div class="block">Default Constructor</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#addConfigured(org.apache.tools.ant.types.ResourceCollection)">addConfigured</a></strong>(<a href="../../../../../../org/apache/tools/ant/types/ResourceCollection.html" title="interface in org.apache.tools.ant.types">ResourceCollection</a> rc)</code>
<div class="block">Support arbitrary file system based resource collections.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#addFileset(org.apache.tools.ant.types.FileSet)">addFileset</a></strong>(<a href="../../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</a> set)</code>
<div class="block">list files to apply the replacement to</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#createRegexp()">createRegexp</a></strong>()</code>
<div class="block">A regular expression.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#createSubstitution()">createSubstitution</a></strong>()</code>
<div class="block">A substitution pattern.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#doReplace(java.io.File, int)">doReplace</a></strong>(java.io.File f,
int options)</code>
<div class="block">Perform the replacement on a file</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#doReplace(org.apache.tools.ant.types.RegularExpression, org.apache.tools.ant.types.Substitution, java.lang.String, int)">doReplace</a></strong>(<a href="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</a> r,
<a href="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</a> s,
java.lang.String input,
int options)</code>
<div class="block">Invoke a regular expression (r) on a string (input) using
substitutions (s) for a matching regex.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#execute()">execute</a></strong>()</code>
<div class="block">Execute the task</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setByLine(boolean)">setByLine</a></strong>(boolean byline)</code>
<div class="block">Process the file(s) one line at a time, executing the replacement
on one line at a time.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setByLine(java.lang.String)">setByLine</a></strong>(java.lang.String byline)</code>
<div class="block"><strong>Deprecated.</strong>
<div class="block"><i>since 1.6.x.
Use setByLine(boolean).</i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setEncoding(java.lang.String)">setEncoding</a></strong>(java.lang.String encoding)</code>
<div class="block">Specifies the encoding Ant expects the files to be in -
defaults to the platforms default encoding.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setFile(java.io.File)">setFile</a></strong>(java.io.File file)</code>
<div class="block">file for which the regular expression should be replaced;
required unless a nested fileset is supplied.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setFlags(java.lang.String)">setFlags</a></strong>(java.lang.String flags)</code>
<div class="block">The flags to use when matching the regular expression.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setMatch(java.lang.String)">setMatch</a></strong>(java.lang.String match)</code>
<div class="block">the regular expression pattern to match in the file(s);
required if no nested <regexp> is used</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setPreserveLastModified(boolean)">setPreserveLastModified</a></strong>(boolean b)</code>
<div class="block">Whether the file timestamp shall be preserved even if the file
is modified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html#setReplace(java.lang.String)">setReplace</a></strong>(java.lang.String replace)</code>
<div class="block">The substitution pattern to place in the file(s) in place
of the regular expression.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.tools.ant.Task">
<!-- -->
</a>
<h3>Methods inherited from class org.apache.tools.ant.<a href="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a></h3>
<code><a href="../../../../../../org/apache/tools/ant/Task.html#bindToOwner(org.apache.tools.ant.Task)">bindToOwner</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#getOwningTarget()">getOwningTarget</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#getRuntimeConfigurableWrapper()">getRuntimeConfigurableWrapper</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#getTaskName()">getTaskName</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#getTaskType()">getTaskType</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#getWrapper()">getWrapper</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#handleErrorFlush(java.lang.String)">handleErrorFlush</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#handleErrorOutput(java.lang.String)">handleErrorOutput</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#handleFlush(java.lang.String)">handleFlush</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#handleInput(byte[], int, int)">handleInput</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#handleOutput(java.lang.String)">handleOutput</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#init()">init</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#isInvalid()">isInvalid</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.String)">log</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.String, int)">log</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.String, java.lang.Throwable, int)">log</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#log(java.lang.Throwable, int)">log</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#maybeConfigure()">maybeConfigure</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#perform()">perform</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#reconfigure()">reconfigure</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#setOwningTarget(org.apache.tools.ant.Target)">setOwningTarget</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#setRuntimeConfigurableWrapper(org.apache.tools.ant.RuntimeConfigurable)">setRuntimeConfigurableWrapper</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#setTaskName(java.lang.String)">setTaskName</a>, <a href="../../../../../../org/apache/tools/ant/Task.html#setTaskType(java.lang.String)">setTaskType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.tools.ant.ProjectComponent">
<!-- -->
</a>
<h3>Methods inherited from class org.apache.tools.ant.<a href="../../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</a></h3>
<code><a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#clone()">clone</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#getDescription()">getDescription</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#getLocation()">getLocation</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#getProject()">getProject</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#setDescription(java.lang.String)">setDescription</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#setLocation(org.apache.tools.ant.Location)">setLocation</a>, <a href="../../../../../../org/apache/tools/ant/ProjectComponent.html#setProject(org.apache.tools.ant.Project)">setProject</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="ReplaceRegExp()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ReplaceRegExp</h4>
<pre>public ReplaceRegExp()</pre>
<div class="block">Default Constructor</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setFile(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFile</h4>
<pre>public void setFile(java.io.File file)</pre>
<div class="block">file for which the regular expression should be replaced;
required unless a nested fileset is supplied.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - The file for which the reg exp should be replaced.</dd></dl>
</li>
</ul>
<a name="setMatch(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMatch</h4>
<pre>public void setMatch(java.lang.String match)</pre>
<div class="block">the regular expression pattern to match in the file(s);
required if no nested <regexp> is used</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>match</code> - the match attribute.</dd></dl>
</li>
</ul>
<a name="setReplace(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setReplace</h4>
<pre>public void setReplace(java.lang.String replace)</pre>
<div class="block">The substitution pattern to place in the file(s) in place
of the regular expression.
Required if no nested <substitution> is used</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>replace</code> - the replace attribute</dd></dl>
</li>
</ul>
<a name="setFlags(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFlags</h4>
<pre>public void setFlags(java.lang.String flags)</pre>
<div class="block">The flags to use when matching the regular expression. For more
information, consult the Perl5 syntax.
<ul>
<li>g : Global replacement. Replace all occurrences found
<li>i : Case Insensitive. Do not consider case in the match
<li>m : Multiline. Treat the string as multiple lines of input,
using "^" and "$" as the start or end of any line, respectively,
rather than start or end of string.
<li> s : Singleline. Treat the string as a single line of input, using
"." to match any character, including a newline, which normally,
it would not match.
</ul></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>flags</code> - the flags attribute</dd></dl>
</li>
</ul>
<a name="setByLine(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setByLine</h4>
<pre>public void setByLine(java.lang.String byline)</pre>
<div class="block"><span class="strong">Deprecated.</span> <i>since 1.6.x.
Use setByLine(boolean).</i></div>
<div class="block">Process the file(s) one line at a time, executing the replacement
on one line at a time. This is useful if you
want to only replace the first occurrence of a regular expression on
each line, which is not easy to do when processing the file as a whole.
Defaults to <i>false</i>.</td></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>byline</code> - the byline attribute as a string</dd></dl>
</li>
</ul>
<a name="setByLine(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setByLine</h4>
<pre>public void setByLine(boolean byline)</pre>
<div class="block">Process the file(s) one line at a time, executing the replacement
on one line at a time. This is useful if you
want to only replace the first occurrence of a regular expression on
each line, which is not easy to do when processing the file as a whole.
Defaults to <i>false</i>.</td></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>byline</code> - the byline attribute</dd></dl>
</li>
</ul>
<a name="setEncoding(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEncoding</h4>
<pre>public void setEncoding(java.lang.String encoding)</pre>
<div class="block">Specifies the encoding Ant expects the files to be in -
defaults to the platforms default encoding.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>encoding</code> - the encoding attribute</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.6</dd></dl>
</li>
</ul>
<a name="addFileset(org.apache.tools.ant.types.FileSet)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addFileset</h4>
<pre>public void addFileset(<a href="../../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</a> set)</pre>
<div class="block">list files to apply the replacement to</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>set</code> - the fileset element</dd></dl>
</li>
</ul>
<a name="addConfigured(org.apache.tools.ant.types.ResourceCollection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addConfigured</h4>
<pre>public void addConfigured(<a href="../../../../../../org/apache/tools/ant/types/ResourceCollection.html" title="interface in org.apache.tools.ant.types">ResourceCollection</a> rc)</pre>
<div class="block">Support arbitrary file system based resource collections.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.8.0</dd></dl>
</li>
</ul>
<a name="createRegexp()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createRegexp</h4>
<pre>public <a href="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</a> createRegexp()</pre>
<div class="block">A regular expression.
You can use this element to refer to a previously
defined regular expression datatype instance</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the regular expression object to be configured as an element</dd></dl>
</li>
</ul>
<a name="createSubstitution()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createSubstitution</h4>
<pre>public <a href="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</a> createSubstitution()</pre>
<div class="block">A substitution pattern. You can use this element to refer to a previously
defined substitution pattern datatype instance.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the substitution pattern object to be configured as an element</dd></dl>
</li>
</ul>
<a name="setPreserveLastModified(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPreserveLastModified</h4>
<pre>public void setPreserveLastModified(boolean b)</pre>
<div class="block">Whether the file timestamp shall be preserved even if the file
is modified.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.8.0</dd></dl>
</li>
</ul>
<a name="doReplace(org.apache.tools.ant.types.RegularExpression, org.apache.tools.ant.types.Substitution, java.lang.String, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doReplace</h4>
<pre>protected java.lang.String doReplace(<a href="../../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types">RegularExpression</a> r,
<a href="../../../../../../org/apache/tools/ant/types/Substitution.html" title="class in org.apache.tools.ant.types">Substitution</a> s,
java.lang.String input,
int options)</pre>
<div class="block">Invoke a regular expression (r) on a string (input) using
substitutions (s) for a matching regex.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - a regular expression</dd><dd><code>s</code> - a Substitution</dd><dd><code>input</code> - the string to do the replacement on</dd><dd><code>options</code> - The options for the regular expression</dd>
<dt><span class="strong">Returns:</span></dt><dd>the replacement result</dd></dl>
</li>
</ul>
<a name="doReplace(java.io.File, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doReplace</h4>
<pre>protected void doReplace(java.io.File f,
int options)
throws java.io.IOException</pre>
<div class="block">Perform the replacement on a file</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>f</code> - the file to perform the relacement on</dd><dd><code>options</code> - the regular expressions options</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if an error occurs</dd></dl>
</li>
</ul>
<a name="execute()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>execute</h4>
<pre>public void execute()
throws <a href="../../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</a></pre>
<div class="block">Execute the task</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../../org/apache/tools/ant/Task.html#execute()">execute</a></code> in class <code><a href="../../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</a></code> - is there is a problem in the task execution.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../org/apache/tools/ant/taskdefs/optional/Rpm.html" title="class in org.apache.tools.ant.taskdefs.optional"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.html" target="_top">Frames</a></li>
<li><a href="ReplaceRegExp.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#fields_inherited_from_class_org.apache.tools.ant.Task">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>