Here's the PERL syntax of string substitution:
VARIABLE =~ s/SEARCH_PATTERN/NEW_STRING/
For instance,
$a = 'abc';
$a =~ s/a/1/; # $a is now '1bc'
Here's the question:
write a substitution statement(ie. s/SEARCH_PATTERN/NEW_STRING/) so
that
"<date>1999-02-25</date>" will be updated to "<date>02-25-1999</date>"
and
"<date>2005-11-03</date>" will be updated to "<date>11-03-2005</date>"
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---
没有评论:
发表评论