> -----Original Message-----
> From: Barry Jones [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 1:15 PM
> To: Beginners @ Perl (E-mail)
> Subject: Escaping characters
> 
> 
> Hi,
>       I'm trying to do a patter match for everything contained within
> {{ stuff }}.  Now I've gotten this to work just fine with ** stuff **,
> ^^ and a several others, but I can't get curly braces to work 
> and I have
> no idea why.  I've tried escaping them with \ and not doing and what
> have you but it just won't work.  Here's the code, maybe you 
> can help me
> out.  Note: the bold tags are just there while I'm testing 
> it, not what
> it's going to be used for.
> 
>  $body =~ s/\{\{(.*?)\}\}/\<b\>$1\<\/b\>/g;

Hmm, works fine for me:

   $body = "Hello {{bold}} world!\n";
   $body =~ s/\{\{(.*?)\}\}/\<b\>$1\<\/b\>/g;
   print $body;

Prints: Hello <b>bold</b> world!

(n.b. you don't need to escape the < and >)

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

Reply via email to