in reply to regexp: extracting info
You almost have it. Two things are wrong:
this will work:
($number) = $str =~ /abc\sdddd\s+(?:ee\s+)?(\d+)/;
As for your question about the two extended operators, they influence capturing of an expression in brackets. perlre really explains it the best way I know, though you may want to take a look at Mastering Regular Expressions which is a very worthwhile book to read when learning regular expressions.
Update:Removed "gs" as they're not necessary (thanks to prasadbabu for pointing that out)
|
|---|