why is sed
not replacing anything:
sed -i '' 's/<a href="\.\.\/\.\.\/ja\/%E6%9C%88\/[^-]\+-page-[\d]\+.html"\/>//g' foo.htm
I want it to match the following string:
<a href="../../ja/%E6%9C%88/%E3%82%A2%E3%83%B3%E3%82%AE%E3%83%A9-page-2013.html"/>
You can't use \d
to match digits with sed. Use [0-9]
or [[:digit:]]
:
sed -i '' 's/<a href="\.\.\/\.\.\/ja\/%E6%9C%88\/[^-]\+-page-[0-9]\+.html"\/>//g' foo.htm
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments