2014-09-23 65 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

相关问题