# Strip duplicates href tags

**URL:** <https://www.ruby-forum.com/t/strip-duplicates-href-tags/136054>\
**Category:** Rails\
**Created:** [April 28, 2008, 2:42pm UTC](https://www.ruby-forum.com/t/strip-duplicates-href-tags/136054 "2008-04-28T14:42:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorchild](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecc23a/32.png) [@rorchild](https://www.ruby-forum.com/u/rorchild)\
**Post date:** [April 28, 2008, 2:42pm UTC](https://www.ruby-forum.com/t/strip-duplicates-href-tags/136054/1 "2008-04-28T14:42:38Z")

</div>

Hi all

i have a text that contains hyperlinked works. some of them appear more  
than once making the text look very saturated with links. how can i  
(using regular expressions), strip duplicate a href tags? for reapeated  
items, hrefs are identical. i want to keep only the first occurance  
hyperlinked. Please let me know how to do this one, thanks in advance.
