Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, how can transform this phrase: <a href="SOME_DOMAIN">link</a> to <a href="SOME_DOMAIN">SOME_DOMAIN</a> How can I, get web address from "a href" statement and replace word "link" with it using sed?...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    7

    Create html link with sed

    Hi, how can transform this phrase:

    <a href="SOME_DOMAIN">link</a>

    to

    <a href="SOME_DOMAIN">SOME_DOMAIN</a>

    How can I, get web address from "a href" statement and replace word "link" with it using sed?

  2. #2
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    Code:
    sed 's/\(.*="\)\(.*\)">link\(.*\)/\1\2">\2\3/'

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    7
    Thanks man, lifesaver.

Posting Permissions

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