Posted By

karlhorky on 10/27/09


Tagged

link search replace text links regular expressions Expression fake searchreplace regularexpresion underlined


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tyster
wirenaught


Regular Expression Search / Replace (PSPad): Replace Fake Links (Underlined Text) with Real Links


 / Published in: Regular Expression
 

Sometimes HTML provided by clients or generated by WYSIWYGs contains links as plaintext with underlines in many instances and stripping this out by hand is time consuming. This search and replace (tested in PSPad, but may work in other code editors) will do the job for you.

  1. Search:
  2. <u>((http|http(s))://)?(www[^<]*)</u>
  3.  
  4. Replace:
  5. <a href="http$3://$4" target="_blank">$1$4</a>

Report this snippet  

You need to login to post a comment.