2014-09-23 98 views
0
$string = '@English is a West Germanic @language that was first spoken in early medieval @England and is now a global lingua franca. @It is spoken as a first language by the'; 

如何在單個操作中刪除以@開始的所有單詞?刪除字符串中特定的開頭

怎麼樣linke str_replace()

`$result = 'is a West Germanic that was first spoken in early medieval and is now a global lingua franca. is spoken as a first language by the'`; 

回答

0

在這裏你去:

echo $string | sed -e 's/@\w*//g' 

該命令替換正則表達式@ \ W *與空字符串匹配所有子。 g標誌確保多個字符串被匹配。

+0

太棒了,thx :),這將工作肯定! – Smeaven 2014-09-23 16:48:10

+0

嗨,我想請你注意這個問題,http://stackoverflow.com/questions/35539960/how-to-get-release-build-apk-file-using-proguard,你的幫助將不勝感激 – 2016-02-22 04:10:56

相關問題