On 11-09-19 08:56 PM, Rajeev Prasad wrote:
$string="alpha number='42'"
$string=~s/.*\=// ;
$string=~s/\'//g;
to get 42 and not '42'
can these two substitutions be combined?
thank you.
It depends on what you want to extract. To extract a string inside
single quotes after an equal sign:
$string =~ s/.*\=\s*\'([^']+)\'/$1/;
--
Just my 0.00000002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great software: Fail early & often.
Eliminate software piracy: use only FLOSS.
"Make something worthwhile." -- Dear Hunter
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/