PCRE regex to sed regex

前端 未结 6 1100
眼角桃花
眼角桃花 2021-01-22 05:32

First of all sorry for my bad english. I\'m a german guy.

The code given below is working fine in PHP:

$string = preg_replace(\'/href=\"(.*?)(\\.|\\,)\"/         


        
6条回答
  •  天涯浪人
    2021-01-22 06:14

    You need a backslash in front of the parentheses you want to reference, thus

    sed 's/href="\(.*?\)(.|\,)"/href="{$\1}"/g' test.htm
    

提交回复
热议问题