我正在尝试找到一种方法将冒号(:)放入一个字符串中,字符串末尾有两个字符.
$meetdays的例子:
1200 => 12:00900 => 9:001340 => 13:40
不确定这应该是正则表达式还是我不知道的另一个函数.
解决方法
s/(?=..$)/:/
不要使用roe对$&的建议. perldoc perlvar:
The use of this variable anywhere in a program imposes a considerable performance penalty on all regular expression matches. See “BUGS”.