2013-01-17 21 views
2

所以我使用artisan新的db:seed爲我的數據庫播種了一些ID,但是現在我需要將所有ID的值增加1.我知道如何找到一個數字,但我可以'弄清楚如何在替換盒中增加它(如果可能的話)。用於在Sublime Text中增加數字的正則表達式2

<?php 
return array(
     array("title"=>'Paris', 
     "country_id"=>0), 
     array("title"=>'Lion', 
     "country_id"=>0), 
     array("title"=>'Nice', 
     "country_id"=>0), 
     array("title"=>'Nantes', 
     "country_id"=>0), 
     array("title"=>'Bordeaux', 
     "country_id"=>0), 
     array("title"=>'Montpellier', 
     "country_id"=>0), 
     array("title"=>'Berlin', 
     "country_id"=>1), 
     array("title"=>'Halle', 
     "country_id"=>1), 
      array("title"=>'Leipzig', 
     "country_id"=>1), 
      array("title"=>'Dredsen', 
     "country_id"=>1), 
    array("title"=>'Hamburg', 
     "country_id"=>1), 
    array("title"=>'Altona', 
     "country_id"=>1), 
     array("title"=>'Rome', 
     "country_id"=>2), 
     array("title"=>'Verona', 
     "country_id"=>2), 
     array("title"=>'Venice', 
     "country_id"=>2), 
     array("title"=>'Milan', 
     "country_id"=>2), 
     array("title"=>'Naples', 
     "country_id"=>2), 
     array("title"=>'Turin', 
     "country_id"=>2), 
     array("title"=>'Luzern', 
     "country_id"=>3), 
     array("title"=>'Zurich', 
     "country_id"=>3), 
      array("title"=>'Berne', 
     "country_id"=>3), 
      array("title"=>'Geneva', 
     "country_id"=>3), 
      array("title"=>'Basel', 
     "country_id"=>3), 
      array("title"=>'Lugano', 
     "country_id"=>3) 
    ); 
+0

你能發表你想增加的文字嗎? –

回答

2

我已經使用Emmet sublime plugin測試了這個。

一旦安裝,搜索\d啓用正則表達式,然後只需點擊按Ctrl +一個遞增所有選定的號碼。

+1

太好了。在Mac上,這個組合已經被用於浮動窗口,所以應該去鍵綁定和改變它(我用super(cmd)+ uparrow) – Matanya

相關問題