pattern = %r{(href='[^']+')}str = "This website is <a href='www.google.com'>Google</a>, some other website is <a href='www.facebook.com'>Facebook</a>"style_to_add = "style='text-decoration:none;'"print str.gsub(pattern, '\1 ' + style_to_add)
Standard input is empty
This website is <a href='www.google.com' style='text-decoration:none;'>Google</a>, some other website is <a href='www.facebook.com' style='text-decoration:none;'>Facebook</a>
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!