in reply to Re: Explaining a Regular Expression
in thread Explaining a Regular Expression
This expression does not always match. The presence of ^ and $ impose conditions that cause it to not always match. The code below shows a simple case which does not match
$data = "This doesn't match\n"; if ($data =~ /^\s*$/) { print "$data Matches\n"; } else { print "$data Does not match\n"; } #OUTPUT #This doesn't match # Does not match
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Explaining a Regular Expression
by rovf (Priest) on Jul 06, 2010 at 15:19 UTC |