A little OT: Reg exp

Results 1 to 2 of 2

Thread: A little OT: Reg exp

  1. #1
    Ben Roy Guest

    Default A little OT: Reg exp

    Sorry to post this here but the reg exp board is not nearly active enough for me to expect any help in a timely fashion. So here&#039s the problem. I&#039m trying to figure out how to replace part of a string with another part (ie $1).<BR><BR>What I really want to do is grab an HTML page and reformat the links:<BR><BR>http://www.website.com/<BR><BR>becomes<BR><BR>javascript:getPage("http://www.website.com")<BR><BR>If I do a pattern match like "&#060;a href=&#039[^&#062;]&#062;" and then do a replace, I don&#039t know how to refer back to the "[^&#062;]". This would be an easy thing in perl but i&#039ve looked through all the info on this site and I can&#039t figure it out. Can someone help me out please?

  2. #2
    Join Date
    Dec 1969

    Default RE: A little OT: Reg exp

    is this a page on your own server?<BR><BR>for(x=0;x&#060;document.links.lengt h;x++){<BR>document.links[x].href = &#039javascript:getPage(&#039&#039 + document.links[x].href + &#039&#039);&#039<BR>}<BR><BR>will replace everything within a page at runtime (the added advantage here is it&#039s reversible). just call the function onload<BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts