----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 30, 2002 11:36 PM
Subject: Regexp with //x


> 
> Can anyone tell me where to find out what the x does when used at the end 
> of a pattern match? (i.e. $tag =~ /abc/x) Everywhere  I've looked gives 
> me the helpful information that it means "Use extended regular 
> expressions," but I've yet to find a definition of what that *means*. 

It allows you to add comments (ignore white space) to your regex
(not sure if it does more than that)...

#!/usr/bin/perl -w

use strict;
my $string='TeSt';
print $string,"\n";
$string=~s/
            ([A-Z])  # grab all letters from A to Z (caps)
          /
            lc($1)   # replace it with lower case version
          /egx;      # Do it globally and allow comments
                     # and evaluate it to make lc() work
print $string,"\n";

%perl test.cgi
TeSt
test

%


Shawn

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


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

Reply via email to