<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" style="task" id="gedit-replace" xml:lang="zh-CN">

  <info>
    <link type="guide" xref="index#gedit-working-with-files"/>
    <link type="seealso" xref="gedit-search"/>
    <desc>Replace portions of text in a file.</desc>
    <revision pkgversion="3.8" date="2013-02-24" status="review"/>
    <revision pkgversion="3.10" date="2013-11-05" status="candidate"/>
    <revision pkgversion="3.14" date="2014-11-28" status="review"/>
    <credit type="author">
      <name>Jim Campbell</name>
      <email>jcampbell@gnome.org</email>
    </credit>
    <credit type="author">
      <name>Daniel Neel</name>
      <email>dneelyep@gmail.com</email>
    </credit>
    <credit type="editor">
      <name>Sindhu S</name>
      <email>sindhus@live.in</email>
    </credit>
    <credit type="editor">
      <name>Ekaterina Gerasimova</name>
      <email>kittykat3756@gmail.com</email>
    </credit>
    <credit type="editor">
      <name>Shobha Tyagi</name>
      <email>tyagishobha@gmail.com</email>
    </credit>
    <include xmlns="http://www.w3.org/2001/XInclude" href="legal.xml"/>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>TeliuTe</mal:name>
      <mal:email>teliute@163.com</mal:email>
      <mal:years>2009, 2011</mal:years>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>Colin Zhao</mal:name>
      <mal:email>lonely.ibm@gmail.com</mal:email>
      <mal:years>2011</mal:years>
    </mal:credit>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>wancheng zhang</mal:name>
      <mal:email>wancheng.com.cn@gmail.com</mal:email>
      <mal:years>2012</mal:years>
    </mal:credit>
  </info>

  <title>替换文本</title>

  <p>修改文本是比较费时的，为了节省时间，<app>gedit</app> 提供了一个 <app>替换</app> 功能，来帮助您查找并替换文本。</p>

  <steps>
    <title>在 <app>gedit</app> 中替换文本</title>
    <item>
      <p>Open the <gui>Replace</gui> tool by clicking
      <guiseq><gui style="button">Menu button</gui><gui style="menuitem">Find 
      and Replace…</gui></guiseq> or press
      <keyseq><key>Ctrl</key><key>H</key></keyseq>.</p>
    </item>
    <item>
      <p>Enter the text that you wish to replace into the <gui>Search
      for:</gui> field.</p>
    </item>
    <item>
      <p>Enter the new, replacement text into the <gui>Replace with:</gui>
      field.</p>
    </item>
    <item>
      <p>Once you have entered the original and replacement text, you can add
      extra parameters to the search. You can also choose what you want to
      replace:</p>
      <list>
        <item>
          <p>To replace <em>only</em> the next match, click
          <gui>Replace</gui>.</p>
        </item>
        <item>
          <p>要替换文档中的<em>所有</em>匹配项，点 <guibutton>替换全部</guibutton>。</p>
        </item>
      </list>
    </item>
  </steps>

  <note style="warning">
    <p>使用 <gui>全部替换</gui> 功能要仔细，它会替换文档中的所有项目，并且不会高亮显示被替换的文本。</p>
  </note>

<section id="replace-options">
  <title>更多选项</title>

  <p>If you wish, you can add some extra parameters to your search:</p>

  <terms>
    <item>
      <title>区分大小写</title>
      <p><em>区分大小写</em> 选项可以指定搜索时是否考虑大小写。选中此项搜索时将会区分字母的大小写，如果不选中，则不区分字母大小写。</p>
    </item>
    <item>
      <title>匹配整个单词</title>
      <p>使用此选项，将会搜索完整的字词，不包括词语的片段，例如，您要搜索“文档”，并且选中此选项，那么单独的“文档”会被搜索到，而“本<em>文档</em>”和“在<em>文档</em>中”都不会被搜索到。</p>
    </item>
    <item>
      <title>反向搜索</title>
      <p>这个命令会让查找改变方向，如果您想让搜索从后往前进行，那么就可以选中此项。</p>
    </item>
    <item>
      <title>回绕模式</title>
      <p>选中<app>回到文档头部继续搜索</app>选项，当查找/替换到文档结尾时，会跳到开头重新进行，这将确保查找/替换文档的所有内容。</p>
    </item>
  </terms>

</section>

<section id="escape-sequences">
  <title>Using escape sequences</title>

  <p>You can use <em>escape sequences</em> to search for line breaks and
  tabs.</p>

  <terms>
    <item>
      <title>\n</title>
      <p>Newline</p>
    </item>
    <item>
      <title>\t</title>
      <p>Tab</p>
    </item>
    <item>
      <title>\r</title>
      <p>Carriage return</p>
    </item>
  </terms>

  <p>If you actually want to search for a <output>\</output> (backslash) or one
  of the escape sequences in the text, you need to escape the backslash with an
  extra backslash. For example, to search for <input>\</input>, you need to
  enter <input>\\</input> into the search or replace field. You can search for
  escape sequences in the same way: to search for or replace with a
  <input>\n</input>, use the <input>\\n</input> term.</p>

</section>

</page>
