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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl string extract
by eyepopslikeamosquito (Archbishop) on Oct 04, 2010 at 06:41 UTC | |
|
Re^2: perl string extract
by eyepopslikeamosquito (Archbishop) on Oct 04, 2010 at 07:07 UTC | |
|
Re^2: perl string extract
by anu_1 (Acolyte) on Oct 04, 2010 at 07:23 UTC |