# Regular expression help

**URL:** <https://www.ruby-forum.com/t/regular-expression-help/146639>\
**Category:** Ruby\
**Created:** [August 23, 2008, 11:27am UTC](https://www.ruby-forum.com/t/regular-expression-help/146639 "2008-08-23T11:27:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [August 23, 2008, 11:27am UTC](https://www.ruby-forum.com/t/regular-expression-help/146639/1 "2008-08-23T11:27:34Z")

</div>

Hi all  
I am Trying To sort Out This Proble for the past 4 Hours…But  
couldn’t Find Any Solutions I have a string …it contains text and  
images also…from that string i want to replace the All The Images Into  
Empty space…  
that is images Has to Be Removed.

```
I tried like below

item.description = item.description.gsub(/\<*img.*src=".*".*?\/\>/,'

```

')

Using This Regular Expression I can able to Reomve Only The First  
Occurrences of The Images,But I Need TO Remove All Occurences Of The  
Images

So Any Guru Can give Me solution…

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [August 23, 2008, 11:48am UTC](https://www.ruby-forum.com/t/regular-expression-help/146639/2 "2008-08-23T11:48:04Z")

</div>

Newb N. wrote:

> ')
> 
> Using This Regular Expression I can able to Reomve Only The First  
> Occurrences of The Images,But I Need TO Remove All Occurences Of The  
> Images
> 
> So Any Guru Can give Me solution…

Someone has already posted a possible solution in your last thread (less  
than 20 minutes before this email). I’m afraid repeating the question  
ad-nauseum won’t get you help any faster.

Matt

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [August 23, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/regular-expression-help/146639/3 "2008-08-23T12:11:47Z")

</div>

Matt H. wrote:

> Newb N. wrote:
> 
> > ')
> > 
> > Using This Regular Expression I can able to Reomve Only The First  
> > Occurrences of The Images,But I Need TO Remove All Occurences Of The  
> > Images
> > 
> > So Any Guru Can give Me solution…
> 
> Someone has already posted a possible solution in your last thread (less  
> than 20 minutes before this email). I’m afraid repeating the question  
> ad-nauseum won’t get you help any faster.
> 
> Matt

No I wrogly posted  
Sorry
