Re: regex question

2001-10-04 Thread Mick Ghazey
my @strings = qw( hello\] hi_there] how_are_you2\] fine-and-you\] good_thanks]); for(@strings){ my $matched = /(.*)\\*?\]$/; if( $matched ) { print "matched! - $1 \n" } else { print "no match - $1 \n" } } matched! - hello\ matched! - hi_there matched! - how_are

RE: regex question

2001-10-04 Thread Lee Goddard
Not sure what you're trying to do, but if you wish to split into strings at the pont ] or \] then just use the split command to split at that string. Put the string in an 'or' block, signified in for perl regex engine as (a|b), where both a and b represent a string, in your case ] and \], though y

regex question

2001-10-04 Thread Schiza, Apostolia (ISS Atlanta)
hello all, I need some help with regex again... I have a file that looks like this: hello\] hi_there] how_are_you2\] fine-and-you\] good_thanks] I need my regex to much all these strings above. The only way now that I can do this is by having 2 regex : while ( ) { if( $_ =~ m/(.*)\\\]/