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 reply to Re: perl string extract
by prasadbabu
in thread perl string extract
by anu_1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |