perl - Remove quotes from regex result -


i have following code:

$source = '<value_date spot_date="2014-11-24" tenor="today">2014-11-20</value_date>';  #get tenor $source=~  /tenor=\s*(.*?)\s*>/;  print $1; 

this prints result of "today" (double quotes part of result). remove double quotes start , end. eg, result of today. can done in regular expression extract tenor? alternatively, what's next best way remove first , last characters, or replace " whitespace?

thanks help.

modify pattern "s not part of capturing group:

$source =~ /tenor="(.*?)">/; 

Comments

Popular posts from this blog

Prolog - Listing -

python - can't seem to get an output from my class -

orchardcms - change base url in local copy in Orchard CMS -