Ruby gsub for Wild Card Search

Hi,

I am very new to Ruby.

I have a script to remove unwanted text from Spiceworks (Ticketing
system).

For that, I need to do a wild card search on a string and replace a
particular text block.

Text block is as below

[Description: Description: Description: Description: Description:
Description: Description: Description: Description: Description:
Description: D:\Users\Documents\My Received
Files\horiz_RGB_Email_Signature_Transparent_400px.png]
[cid:image002.png@01CF32E4.E5D83D80]<http://www.facebook.com/MusicAU>[cid:image003.png@01CF32E4.E5D83D80]<http://instagram.com/music>[cid:image004.png@01CF32E4.E5D83D80]<https://twitter.com/Music>[cid:image005.png@01CF32E4.E5D83D80]<http://www.youtube.com/user/Music>

However in the above block .png@XXXXXX.XXXXXX can change on every
ticket. So I have to use wild card to replace it.

Not sure how to do wildcard search in the whole text.
Start: [Description:
End: <http://www.youtube.com/user/Music>

I am using following which only replaces first [Description.
    db_text = db_text.gsub("[Description: Description: Description:
Description: Description: Description: Description: Description:
Description: Description: Description:","")

Not sure where and what to put for wild card search.

Please help me.

···

--
Posted via http://www.ruby-forum.com/.

What is it exactly that you want to replace? Can you show from the
example text above, what would be your required output? And also, in
other texts that you will process, what will vary from one to another,
only what is after the @?

Jesus.

···

On Wed, Feb 26, 2014 at 2:18 AM, Chirag Jhaveri <lists@ruby-forum.com> wrote:

Hi,

I am very new to Ruby.

I have a script to remove unwanted text from Spiceworks (Ticketing
system).

For that, I need to do a wild card search on a string and replace a
particular text block.

Text block is as below

[Description: Description: Description: Description: Description:
Description: Description: Description: Description: Description:
Description: D:\Users\Documents\My Received
Files\horiz_RGB_Email_Signature_Transparent_400px.png]
[cid:image002.png@01CF32E4.E5D83D80]<http://www.facebook.com/MusicAU&gt;\[cid:image003\.png@01CF32E4\.E5D83D80\]&lt;http://instagram.com/music&gt;\[cid:image004\.png@01CF32E4\.E5D83D80\]&lt;https://twitter.com/Music&gt;\[cid:image005\.png@01CF32E4\.E5D83D80\]&lt;http://www.youtube.com/user/Music&gt;

However in the above block .png@XXXXXX.XXXXXX can change on every
ticket. So I have to use wild card to replace it.

Not sure how to do wildcard search in the whole text.
Start: [Description:
End: <http://www.youtube.com/user/Music&gt;

I am using following which only replaces first [Description.
    db_text = db_text.gsub("[Description: Description: Description:
Description: Description: Description: Description: Description:
Description: Description: Description:","")

Not sure where and what to put for wild card search.