I am trying to write regex for replacing string.
There are string examples:
I am student.
I <a href="am.html">am</a> student.
I want to write regex which will replace "am" with <a>
html tag, and get second string as result of replacing the first string.
Problem is nesting in quotes and text inside tag.
For example if I try to replace string "am" in this example:
I <a href="am.html">am</a> am student.
Result should be:
I <a href="am.html">am</a> <a href="am.html">am</a> student.
Thanks in advance!