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

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -