ruby on rails regular expression to remove html tags and its content from text

Posted by salilgaikwad on Stack Overflow See other posts from Stack Overflow or by salilgaikwad
Published on 2010-03-19T07:41:53Z Indexed on 2010/03/19 8:01 UTC
Read the original article Hit count: 253

Filed under:
|

Hi All,

I want regular expression in ruby on rails which remove all the html tags and its content from the given text.

For example if my text is :-INPUT :-

<span id="span_is"><br><br><u><i>Hi</i></u></span> 

then it should display only OUTPUT should be as follows:-

Hi

in short i want regular expression or a function which remove <> and whatever the content between <>.

Thanks & Regards,

Salil Gaikwad

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby