In a message dated 7/23/2006 9:39:34 A.M. Pacific Standard Time,  
[EMAIL PROTECTED] writes:


[EMAIL PROTECTED] wrote:
> Hi,
>  
> I am a  beginner in perl and am having a dickens of a time trying to  
identify  
> this pattern in messages.  [URL
>  
> Here is  what I have:
>  
>             if  ($FORM{'message} =~ /\[URL/ig)  {
> #do   something;
> }
>
> Where $FORM('message') is a messaage that  includes many lines and  
>  [url=http://www.mywebspace.com[/url].  But this doesn't result in true  
even  though I 
> know the message contains the string [url. Can  anyone tell me what  could 
be the 
> problem? Or perhaps a better  way to identify a messages with the  [url 
> anywhere in it. Thanks  for any help.
>  
>  
>
>    

works for me!
I assume missing ' is just a typo else you would get  compile error

[EMAIL PROTECTED] re]$ cat url.pl
#! /usr/bin/perl

use  strict;
use warnings;

my %FORM;

$FORM{'message'} = "
Where  \$FORM('message') is a messaage that includes many lines and  
[url=http://www.mywebspace.com[/url].  But this doesn't result in  true 
even  though I
know the message contains the string [url. Can  anyone tell me what  
could be the
problem? Or perhaps a better way  to identify a messages with the  [url
anywhere in it. Thanks for any  help.";



This works as long as the escaped bracket is not included. As soon  as I 
include the \[ it no longer works?  No longer returns true. There has  to be an 
answer to this? I don't get it? Could it be attempting to match the \  as well?
 



Reply via email to