i did not see an html topic so i posted here. sorry for this. i feel very :evil:
I have a list of links that are just 's
is there an easy way of changing those into html links with thdomain as the anchor text.
other wise i would have to manually make 500 links into html links

Dani AI

Generated

Useful options beyond the suggestions in the thread: a single regex replace in a capable editor or a short script will convert bare URLs into proper anchors and use the host as the visible text. This avoids manual edits for hundreds of links and complements 's and 's editor-based ideas; 's Linkifier is a perfectly valid quick tool if a GUI utility is preferred.

A compact regex approach (PCRE-style) that captures protocol, host, and the rest of the URL:

Find:  (https?:\/\/)([^\/\s"<>]+)([^\s"<>]*)
Replace: <a href="$1$2$3">$2</a>

If the editor uses backreference syntax like \1/\2 instead of $1/$2, use:

Replace: <a href="\1\2\3">\2</a>

Explanation: group 1 = protocol, group 2 = domain/host (used as anchor text), group 3 = path/query. Run the replace on a copy first to confirm behavior.

A small Python option for more control (reads stdin, writes stdout):

import re, sys
p = re.compile(r'(https?://)([^/\s"<>]+)([^\s"<>]*)')
def repl(m):
    return '<a href="%s">%s</a>' % (m.group(0), m.group(2))
print(p.sub(repl, sys.stdin.read()), end='')

Notes and pitfalls: back up files before bulk edits; strip or exclude trailing punctuation (periods, commas, closing parentheses) if needed; avoid touching URLs already inside existing <a> tags—use an HTML-aware method (parse DOM or use BeautifulSoup) to modify only text nodes when working with full HTML files. Test on a small subset, then run the global replace.

Recommended Answers

All 3 Replies

You could use something like Homesite and run a global search and replace on the site.

Eddie

DHTML Nirvana
http://dhtmlnirvana.com/

Spiritual Blog

EditPad from jgsoft will do it too using regular expressions or normal searches - but there's no really easy way.

Sarah

i found an awesome program called linkifier that works

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.