Regular Expressions

Pls Any one Help…
what is the regular expressions to Extract the image url which contains
.png .gif .jpg file extensions.

To Extract the file Name from the image url what Regular Expressions
has to Be Used.
Nothing Found to Be working.I m Still On the Confusion.
Pls Help

Newb N. wrote:

Pls Any one Help…
what is the regular expressions to Extract the image url which contains
png .gif .jpg file extensions.

To Extract the file Name from the image url what Regular Expressions
has to Be Used.
Nothing Found to Be working.I m Still On the Confusion.
Pls Help

You have asked this question before; this might make some here concerned
you
won’t use the answers already provided.

Your best bet has always been Hpricot, to find, store, and
optionally
erase the image sources. You already posted a solution with
.search(’//img’).
The step to store the images would be something like this:

doc.search("//img").each do |img|
puts img.attributes[‘src’]
end

A further regexp using /.jpg$/ would match strings with .jpg on the end,
but be
warned there are many variations of image filenames, including, for
example, .JPEG.

Please post back what you did with this advice (if anything!), instead
of
continuing to ask the same question over and over again!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs