Regular Expressions

N

Newb Newb

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
 
P

Phlip

Newb said:
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top