<doc>
  <legacy_id>1517</legacy_id>
  <name>replaceText</name>
  <type>function</type>
  <syntax>
    <example>replaceText(<i>stringToChange</i>,<i>matchExpression</i>,<i>replacementString</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
  </classification>
  <references>
    <property tag="caseSensitive">caseSensitive Property</property>
    <command tag="filter">filter Command</command>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Searches for a <glossary tag="regular expression">regular expression</glossary> and replaces the portions that match the <glossary tag="regular expression">regular expression</glossary>.</summary>
  <examples>
    <example>replaceText("malformed","mal","well") <code><i>-- returns "wellformed"</i></code></example>
    <example>replaceText(field "Stats",return,comma) <code><i>-- makes comma-delimited</i></code></example>
  </examples>
  <description>
    <p>Use the <b>replaceText</b> <href tag="">function</href> to search for and replace text that matches a particular pattern.</p>
<p>&nbsp;</p>
<p><b>Parameters:</b></p>
<p>The <i>stringToChange</i> is any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="string">string</keyword>.</p>
<p>&nbsp;</p>
<p>The <i>matchExpression</i> is a <glossary tag="regular expression">regular expression</glossary>.</p>
<p>&nbsp;</p>
<p>The <i>replacementString</i> is any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="string">string</keyword>.</p>
<p>&nbsp;</p>
<p><b>Value:</b></p>
<p>The <b>replaceText</b> <href tag="">function</href> returns the changed <keyword tag="string">string</keyword>.</p>
<p>&nbsp;</p>
<p><b>Comments:</b></p>
<p>The <b>replaceText</b> <href tag="">function</href> replaces all the occurrences of the <i>matchExpression</i> with the <i>replacementString</i>. If more than one matching substring is found, the <b>replaceText</b> <href tag="">function</href> replaces all of them.</p>
<p>&nbsp;</p>
<p>The <b>replaceText</b> <href tag="">function</href> is not as fast as the <command tag="replace">replace</command> <glossary tag="command">command</glossary>, but is more flexible because you can search for any text that matches a <glossary tag="regular expression">regular expression</glossary>.</p>
<p>&nbsp;</p>
<p>The <i>stringToChange</i> and <i>matchExpression</i> are always <href tag="">case-sensitive</href>, regardless of the setting of the <property tag="caseSensitive">caseSensitive</property> <glossary tag="property">property</glossary>.  (If you need to make a <href tag="">case-insensitive</href> comparison, use "(?i)" at the start of the <i>matchExpression</i> to make the match case-insensitive.)</p>
<p><b>Note:</b> A number of characters in regular expressions have special meanings and need to be escaped with back slashes For example period (".") matches any character, so in order to replace period characters with a regular expression use "\." . For more information on regular expressions see the Perl documentation here: &lt;http://perldoc.perl.org/perlre.html&gt;</p>
<p>&nbsp;</p>
  </description>
</doc>