# Highlight search terms

**URL:** <https://www.ruby-forum.com/t/highlight-search-terms/90599>\
**Category:** Rails\
**Created:** [March 30, 2007, 6:00am UTC](https://www.ruby-forum.com/t/highlight-search-terms/90599 "2007-03-30T06:00:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@matthew](https://www.ruby-forum.com/u/matthew)\
**Post date:** [March 30, 2007, 6:00am UTC](https://www.ruby-forum.com/t/highlight-search-terms/90599/1 "2007-03-30T06:00:48Z")

</div>

Hi

I can’t seem to find a configurable Ruby search term highlighter out  
there - can’t believe there isn’t one ?

I’ve reviewed TextHelper.highlight but it’s to simple for my  
requirements. I need to be able to exclude html when highlighting.  
Something similar to PHP str\_highlight :

[http://aidanlister.com/repos/v/function.str\_highlight.php](http://aidanlister.com/repos/v/function.str_highlight.php)

If no suggestions then I guess I’ll have to write some code 😉

Thanks

Matt
