in reply to perl string extract
Please ignore this node.
Something like this?
Updated: Misunderstood the question. Added '?' after comma to make it optional.use strict; use warnings; my $line = 'logfile = filename , abcd=eflk , cxd'; my $file; if ($line =~ /logfile\s*\=\s*(.+?)\s*\,?/){ $file=$1; } print "logfile=$file"; output: ======= logfile=filename
eyepopslikeamosquito++ Thanks.
Prasad
In Section
Seekers of Perl Wisdom