I thought using the /g option grabbed ALL matches per line. What am I doing wrong? Thanksopen(FILE, $file) or &error; @data = <FILE>; close(FILE); @extracted = (); foreach(@data){ if($_ =~ /.*?(foo\d+).*?/g){ push @extracted, $1; } }
In reply to Regex help by TheFifthDeuce
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |