in reply to Regular Expression matching question
The regular expression you have entered will match anything.
$text = 'I like donkeys'; if ($text =~ /a*((ab)*|b*)/) { print "Success ($1)\n"; }
What you've written there is:
$text =~ / a* # zero or more of 'a' ( # followed by (ab)* # zero or more of 'ab' | # or b* # zero or more of 'b' )/x
So please, less of this 'perl is dead'. Go and read through perlre.
|
|---|