Your problem is that you have used a char set where you intended a capture. The fixed (and simplified) regex looks like /("[^"]*")/.
use strict; use warnings; my @test; while (my $line = <DATA>) { if ($line =~ /("[^"]*")/) { my $keep = $1; push(@test,$keep); } } (print join "\n", @test) if @test; __DATA__ rmdir: directory "SAS_util0001000021A9_sasux101": Directory rmdir: directory "SAS_util000100002E19_sasux101": Directory rmdir: directory "SAS_util000100005891_sasux101": Directory
Prints:
"SAS_util0001000021A9_sasux101" "SAS_util000100002E19_sasux101" "SAS_util000100005891_sasux101"
In reply to Re: Reg Ex with quotes
by GrandFather
in thread Reg Ex with quotes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |