简体   繁体   English

使用sed将alt属性替换为title属性

[英]Substitute alt attribute with title attribute using sed

I have a PCRE regex that looks like this 我有一个看起来像这样的PCRE正则表达式

s/(<input.+?)alt(=".+?".*?>)/$1title$2/

Can anybody help me with making that work on sed? 有人可以帮助我在sed上进行这项工作吗?

Eventually can anybody point me to some guide/blog post/whatever that explains differences between sed regex and PCRE? 最终有人能指出我一些指南/博客文章/任何解释sed regex和PCRE之间差异的内容吗?

I think it's something like this: 我认为是这样的:

's/\(\<input[^>]\+\?\)alt\(=[^>]\+\?>\)/\1title\2/g'

And this is a good site for understanding sed. 是了解sed的好网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM