[Templates-cvs] cvs commit: Template2/docsrc/src/Manual VMethods.tt2

cvs@template-toolkit.org cvs@template-toolkit.org
Wed, 18 Jun 2003 14:28:36 +0100


cvs         03/06/18 13:28:35

  Modified:    docsrc/src/Manual VMethods.tt2
  Log:
  Documented (?x) style of passing modifiers to regexes; see http://www.template-toolkit.org/pipermail/templates/2003-April/004541.html.
  
  Revision  Changes    Path
  1.5       +12 -0     Template2/docsrc/src/Manual/VMethods.tt2
  
  Index: VMethods.tt2
  ===================================================================
  RCS file: /template-toolkit/Template2/docsrc/src/Manual/VMethods.tt2,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- VMethods.tt2	2003/05/13 22:56:35	1.4
  +++ VMethods.tt2	2003/06/18 13:28:35	1.5
  @@ -61,6 +61,18 @@
          pattern does not match
       [% END %]
   
  +Any regex modifiers, like C</s>, should be added in the regex using
  +the C<(?s)> syntax.  For example, to modify the regex to disregard
  +whitespace (the C</x> switch), use:
  +
  +    [% re = '(?x)
  +               (\w+)
  +               [ ]
  +               (\w+)
  +             ';
  +      matches = name.match(re);
  +    %]
  +
   =item search(pattern)
   
   Performs a similar function to 'match' but simply returns true if the