anu_1 has asked for the wisdom of the Perl Monks concerning the following question:
But it will not work if the line is "logfile= filename", Is there any way for this particular case to specify there could be zero or one occurrence of comma. Thanks for your help$line="logfile = filename , abcd=eflk , cxd"; $line=~/logfile\s*=\s*(.*?),/$1/; $file=$1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl string extract
by eyepopslikeamosquito (Archbishop) on Oct 04, 2010 at 06:29 UTC | |
by anu_1 (Acolyte) on Oct 04, 2010 at 06:50 UTC | |
|
Re: perl string extract
by ig (Vicar) on Oct 04, 2010 at 10:12 UTC | |
|
Re: perl string extract
by Utilitarian (Vicar) on Oct 04, 2010 at 13:54 UTC | |
|
Re: perl string extract
by prasadbabu (Prior) on Oct 04, 2010 at 06:28 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 04, 2010 at 06:41 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 04, 2010 at 07:07 UTC | |
by anu_1 (Acolyte) on Oct 04, 2010 at 07:23 UTC |