On Jan 15, birgit kellner said:

>$rec{'content'} = qq|<!-- start query --><input type=hidden name="227" 
>value="77"><dl><dt><dd>"Madhyamaka." In: "Buddhismus in Geschichte und 
>Gegenwart, Bd. I." Hamburg: Universität Hamburg (Weiterbildendes Studium) 
>1998, 180-189.</dl><input type=hidden name="230" 
>value="77"><dl><dt><dd>"Zum Konzept der Leerheit im BCA." In: "Buddhismus 
>in Geschichte und Gegenwart, Bd. III: ZAntidevas "Eintritt in das Leben zur 
>Erleuchtung"." Hamburg: Universität Hamburg (Weiterbildendes Studium) 1999, 
>61-80.</dl><input type=hidden name="229" value="77"><dl><dt><dd>"The 
>PrasannapadA: More Manuscripts from Nepal." &nbsp;44 (2000), 
>165-181.</dl><input type=hidden name="305" value="77"><dl><dt><dd>"Die 
>Sicht der Leerheit." Tibet und Buddhismus&nbsp;52 (2000), 8-13.</dl><!-- 
>end query -->alkjd öslkfdj|;
>
>if ($rec{'content'} =~ /(<!-- start query -->.*?<!-- end query -->)/s) {
>       print "YES: there is content with query tags\n";
>       my $query = "$1";
>       print "QUERY\n---------------------\n$query\n-------------\n";
>       $rec{'content'} =~ s/$query/!query!/s;

You want s/\Q$query\E/!query!/ instead.  $query contains some regex
metacharacters -- specifically ( and ) -- that don't match themselves, but
rather do grouping.  That is:

  "abc(def)ghi" =~ /abc(def)ghi/;

does not match, since the ( does not match a '(' character.  The \Q...\E
thing automatically escapes any potential regex character.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to