~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/stdlib/doc/src/regexp.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        <v>RepCount = integer()</v>
133
133
      </type>
134
134
      <desc>
135
 
        <p>Substitutes the first occurrence of a substring matching <c>RegExp</c> in <c>String</c> with the string <c>New</c>. A <c><![CDATA[&]]></c> in the string <c>New</c> is replaced by the matched substring of <c>String</c>.  <c><![CDATA[\\&]]></c> puts a literal <c><![CDATA[&]]></c> into the replacement string. It returns as follows:</p>
 
135
        <p>Substitutes the first occurrence of a substring matching <c>RegExp</c> in <c>String</c> with the string <c>New</c>. A <c><![CDATA[&]]></c> in the string <c>New</c> is replaced by the matched substring of <c>String</c>.  <c><![CDATA[\&]]></c> puts a literal <c><![CDATA[&]]></c> into the replacement string. It returns as follows:</p>
136
136
        <taglist>
137
137
          <tag><c>{ok,NewString,RepCount}</c></tag>
138
138
          <item>
286
286
      <item>
287
287
        <p>matches the non-metacharacter <c>c</c>.</p>
288
288
      </item>
289
 
      <tag>\\c</tag>
 
289
      <tag>\c</tag>
290
290
      <item>
291
291
        <p>matches the escape sequence or literal character <c>c</c>.</p>
292
292
      </item>
341
341
    <p>The escape sequences allowed are the same as for Erlang
342
342
      strings:</p>
343
343
    <taglist>
344
 
      <tag><c>\\b</c></tag>
 
344
      <tag><c>\b</c></tag>
345
345
      <item>
346
346
        <p>backspace</p>
347
347
      </item>
348
 
      <tag><c>\\f</c></tag>
 
348
      <tag><c>\f</c></tag>
349
349
      <item>
350
350
        <p>form feed </p>
351
351
      </item>
352
 
      <tag><c>\</c></tag>
 
352
      <tag><c>\n</c></tag>
353
353
      <item>
354
354
        <p>newline (line feed) </p>
355
355
      </item>
356
 
      <tag><c>\\r</c></tag>
 
356
      <tag><c>\r</c></tag>
357
357
      <item>
358
358
        <p>carriage return </p>
359
359
      </item>
360
 
      <tag><c>\\t</c></tag>
 
360
      <tag><c>\t</c></tag>
361
361
      <item>
362
362
        <p>tab </p>
363
363
      </item>
364
 
      <tag><c>\\e</c></tag>
 
364
      <tag><c>\e</c></tag>
365
365
      <item>
366
366
        <p>escape </p>
367
367
      </item>
368
 
      <tag><c>\\v</c></tag>
 
368
      <tag><c>\v</c></tag>
369
369
      <item>
370
370
        <p>vertical tab </p>
371
371
      </item>
372
 
      <tag><c>\\s</c></tag>
 
372
      <tag><c>\s</c></tag>
373
373
      <item>
374
374
        <p>space </p>
375
375
      </item>
376
 
      <tag><c>\\d</c></tag>
 
376
      <tag><c>\d</c></tag>
377
377
      <item>
378
378
        <p>delete </p>
379
379
      </item>
380
 
      <tag><c>\\ddd</c></tag>
 
380
      <tag><c>\ddd</c></tag>
381
381
      <item>
382
382
        <p>the octal value ddd </p>
383
383
      </item>
384
 
      <tag><c>\\xhh</c></tag>
 
384
      <tag><c>\xhh</c></tag>
385
385
      <item>
386
386
        <p>The hexadecimal value <c>hh</c>.</p>
387
387
      </item>
388
 
      <tag><c>\\x{h...}</c></tag>
 
388
      <tag><c>\x{h...}</c></tag>
389
389
      <item>
390
390
        <p>The hexadecimal value <c>h...</c>.</p>
391
391
      </item>
392
 
      <tag><c>\\c</c></tag>
 
392
      <tag><c>\c</c></tag>
393
393
      <item>
394
 
        <p>any other character literally, for example <c>\\\\</c> for backslash,
395
 
          <c>\\"</c> for ")</p>
 
394
        <p>any other character literally, for example <c>\\</c> for backslash,
 
395
          <c>\"</c> for ")</p>
396
396
      </item>
397
397
    </taglist>
398
398
    <p>To make these functions easier to use, in combination with the
399
399
      function <c>io:get_line</c> which terminates the input line with
400
400
      a new line, the <c>$</c> characters also matches a string ending
401
 
      with <c>"...\ "</c>. The following examples
 
401
      with <c>"...\n"</c>. The following examples
402
402
      define Erlang data types:</p>
403
403
    <pre>
404
404
Atoms     [a-z][0-9a-zA-Z_]*
405
405
 
406
406
Variables [A-Z_][0-9a-zA-Z_]*
407
407
 
408
 
Floats    (\\+|-)?[0-9]+\\.[0-9]+((E|e)(\\+|-)?[0-9]+)?</pre>
409
 
    <p>Regular expressions are written as Erlang strings when used with the functions in this module. This means that any <c>\\</c> or <c>"</c> characters in a regular expression
410
 
      string must be written with <c>\\</c> as they are also escape characters for the string. For example, the regular expression string for Erlang floats is:
411
 
      <c>"(\\\\+|-)?[0-9]+\\\\.[0-9]+((E|e)(\\\\+|-)?[0-9]+)?"</c>.</p>
 
408
Floats    (\+|-)?[0-9]+\.[0-9]+((E|e)(\+|-)?[0-9]+)?</pre>
 
409
    <p>Regular expressions are written as Erlang strings when used with the functions in this module. This means that any <c>\</c> or <c>"</c> characters in a regular expression
 
410
      string must be written with <c>\</c> as they are also escape characters for the string. For example, the regular expression string for Erlang floats is:
 
411
      <c>"(\\+|-)?[0-9]+\\.[0-9]+((E|e)(\\+|-)?[0-9]+)?"</c>.</p>
412
412
    <p>It is not really necessary to have the escape sequences as part of the regular expression syntax as they can always be generated directly in the string. They are included for completeness and can they can also be useful when generating regular expressions, or when they are entered other than with Erlang strings.</p>
413
413
  </section>
414
414
</erlref>