Daniel,
Inside [ ] means "any of the following", so you don't use the | as an OR
in this situation. Take the | out and you should be fine. Here's my
example:

#!/usr/bin/perl -w

use strict;
my $variable1; my @variable2; my %variable3;
$variable1=1; @variable2=(1,2,3); %variable3=(1,2,3,4);
# |SOMETEXT should NOT get matched

open INFILE, $0;
while (<INFILE>) {
    while (m#([EMAIL PROTECTED])#g) {
        print "$1\n";
    }
}
close INFILE;

Pete

On Thu, 2003-03-06 at 02:35, Daniel Mueller wrote:
> i'm currently trying to match all variables in a file, the regex i use looks
> like this :
> m/([\$|\@|\%]\w+)/g
> it matches as far as i can see what i want but it also matches stuff like
> this :
> |SOMETEXT


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

Reply via email to