Igiwwa
asked on
Reg Ex Alter and Replace
Hello All.
I need to change:
<previous art_id="[something]">[some thing2]</p revious>
to
<a href="[something2]">[somet hing2]</a>
However, the first for the first [something2] I need to replace special characters like whitespaces before i rewrite it. So this wouldn't work:
$content=~s /<previous art_id=\"[a-zA-Z0-9._-]+\" >(.*)<\/pr evious>/<a href=\"$1\">$1<\/a>/gi;
Because the first $1 still has characters that I want to replace for links.
For an actual example:
<previous art_id="insurance">Homeown er's Insurance</previous>
needs to be
<a href="Homeowner's+Insu rance">Hom eowner's Insurance</a>
Thanks for the help in advance! Hope I made everything clear enough.
I need to change:
<previous art_id="[something]">[some
to
<a href="[something2]">[somet
However, the first for the first [something2] I need to replace special characters like whitespaces before i rewrite it. So this wouldn't work:
$content=~s /<previous art_id=\"[a-zA-Z0-9._-]+\"
Because the first $1 still has characters that I want to replace for links.
For an actual example:
<previous art_id="insurance">Homeown
needs to be
<a href="Homeowner's+Insu
Thanks for the help in advance! Hope I made everything clear enough.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER