大家好。
我正在寻找一种方法来做与 PHP 的 preg_replace() 相同的事情在 shell 脚本中执行(搜索与正则表达式匹配的文本并替换它)。
因此,请考虑以下文件。
<a href="http://example.com/">Website #1</a>
<a href="http://example.net/">Website #2</a>
<a href="http://example.org/">Website #3</a>
我想得到这个:
http://example.com/
http://example.net/
http://example.org/
有没有办法做到这一点?谢谢。
最佳答案
关于php - 相当于 PHP 的 preg_replace() 的 Shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4490927/