Replacing with / in HTML links

Replacing with / in HTML links

5
NewbieNewbie
5

    May 08, 2006#1

    In a list of HTML links like this, I'd like to replace all "\" inside the link with "/", but not inside any link text. I'm close, but there is something wrong with my looping.

    before:
    <a href="\html\constrbot.html">Link text to this page</a>
    <a href="\html\consumer.html">Another link text</a>
    <a href="\html\contact.html">More link text but with this character \ </a>
    <a href="\html\croton.html">Also has the \ character</a>

    desired result:
    <a href="/html/constrbot.html">Link text to this page</a>
    <a href="/html/consumer.html">Another link text</a>
    <a href="/html/contact.html">More link text but with this character \</a>
    <a href="/html/croton.html">Also has the \ character</a>

    This script works for the first occurence, but then stops, and repeating the macro again selects the first line field (now corrected) and alerts "Search string not found!"

    InsertMode
    ColumnModeOff
    HexOff
    UnixReOff
    Top
    Loop
    Find RegExp "href[~>]+"
    IfFound
    StartSelect
    Find "\"
    Replace All SelectText "/"
    EndSelect
    Else
    ExitLoop
    EndIf
    EndLoop
    Top

    206
    MasterMaster
    206

      May 09, 2006#2

      Added an EndIf !
      Software For Metalworking
      http://closetolerancesoftware.com

      5
      NewbieNewbie
      5

        May 09, 2006#3

        Nice, thanks!