in reply to Text Extraction Problems

Why making it so complicated? You could use a much simpler regular expression and then remove the quotes later.

#!/usr/bin/perl -w use strict; while (<DATA>) { chomp; print "$_\n"; if (/-(\S+)(\s*(.*))?/x) { my ($p1, $p2) = ($1, $3); if (defined $p2) { $p2 =~ s/^"//; $p2 =~ s/"$//; } print "[$p1][$p2]\n"; } } __DATA__ -libs "source*.lib source*.lib" -1dlu -2dlu -3dlu "(1,1,3)" -filter ASDF