开发者

sed + change small and capital letter

I hav开发者_运维问答e the following

 echo "<x>small<X>capital" | sed s'/<x>/WORD/'g

How to change sed syntax in order to replace x and X with WORD

in this sed . sed replace only the small letter x

THX yael


 echo "<x>small<X>capital" | sed s'/<[Xx]>/WORD/'g


In GNU sed, you can use a case-insensitive modifier:

echo "<x>small<X>capital" | sed 's/<x>/WORD/ig'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜