Ratna_Ranjan has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; my $string='Apropovir,"Atripla(tenofovir+emtricitabine+ efavirenz)",'; my @tokens=split(/,\"/,$string);#split using comma"es for my $each(@tokens) { $each=~s/\"//;#match quotes and substitute with nothing print "$each\n"; }
output
Apropovir Atripla (tenofovir + emtricitabine + efavirenz),
what i want is how do i match two or more characters such as the comma and ending quotes and substitute with nothing so that i get an output without a comma in the second string??
Apropovir Atripla (tenofovir + emtricitabine + efavirenz)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching two or more characters and substituting
by ikegami (Patriarch) on Nov 06, 2009 at 21:05 UTC | |
|
Re: matching two or more characters and substituting
by keszler (Priest) on Nov 06, 2009 at 21:11 UTC |