我正在使用sed命令查找/controller which is a word/action
"href="/bdgp/bdgp-record-com1-form?type=R&year=<?php echo $year;?>&batchNumber=<?php echo $this->escapehtml($animal->BATCH_NUMBER);?> "
会改变结果......
href="<?php echo $this->url("bdgp", array("action"=>"bdgp-record-com1-form"))?>?type=R&year=<?php echo $year;?>&batchNumber=<?php echo $this->escapehtml($animal->BATCH_NUMBER);?>
这是我正在使用的sed命令,它找到像/ anything / anything / anything
这样的模式sed -i 's%href=\"\/\([^/]*\)\/\([^/]*\)?\([^/]*\)%href=\"<?php echo $this->url(\"\1\", array(\"action\"=>\"\2\"))?> \"<%g' changes.txt;
我得到的是这个......
href="<?php echo $this->url("bdgp", array("action"=>"bdgp-record-com1-form?type=R&year=<?php echo $year;?>&batchNumber=<?php echo $this->escapehtml($animal->BATCH_NUMBER);?>
如何从结果中提取出?type = R&amp; year =&amp; batchNumber = escapehtml($ animal-&gt; BATCH_NUMBER);?&gt;并把它放在最后?
由于