Users Pricing

forum

home / developersection / forums / replacing link tag using regex

Replacing link tag using regex

Anonymous User 2242 14 Oct 2013

I'm using java. And i want to find then replace hyperlink and anchor text of tag <a> html. I knew i must use: replace() method but i'm pretty bad about regex. An example:

<a href="http://example.com">anchor text 1</a>

will be replaced by:

<a href="http://web.com">anchor text 2</a>

Could you show my the regex for that purpose?

Thanks a lot.


I am a content writter !


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md