tags:

views:

42

answers:

1

I have a PCRE regex that looks like this

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

Can anybody help me with making that work on sed?

Eventually can anybody point me to some guide/blog post/whatever that explains differences between sed regex and PCRE?

A: 

I think it's something like this:

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

And this is a good site for understanding sed.

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