有没有办法用sed替换等长的其他东西(例如点,零等)的模式?像这样:
maci:/ san$ echo "She sells sea shells by the sea shore" | sed 's/\(sh[a-z]*\)/../gI'
.. sells sea .. by the sea ..
Run Code Online (Sandbox Code Playgroud)
("我"需要更新版本的sed来忽略大小写)
这很简单:以"sh"开头的单词被双点(..)替换但是如何使它成为这样的东西:... sells sea ...... by the sea .....
任何的想法?干杯!