如何将下列匹配转换为给定结果?如何使用Perl重新排列此模板中项目的顺序?
我的文件有以下比赛
-- cut --
Lorem ipsun Hello lorem ipsun { $hello }
@param integer $question_id // example of the match
Lorem ipsun Hello lorem ipsun { $hello }
-- cut --
我想有效地改变他们
@param $question_id integer
我的伪代码尝试
perl -i.bak -pe `s/(@param) (\\w) ($\\w)/$1 $3 $2/`
代表您填写的参数或字符串“@参数”的文本中的@符号,同一问题与$ -sign by $ question-id – 2009-08-31 15:30:44
@Commusoft:@参数是问题中的一个符号类似于$ in $ question_id – hhh 2009-08-31 15:45:46