From: Constantine Karnacevych Date: 2008-11-29T10:09:56+09:00 Subject: Re: regex for capturing images > but in my code: > matchdata = > text.match(/(https?:(?:\/*[a-zA-Z]*\.*-*\d*)*(?:\.gif|\.jpg|\.bmp|\.png|\.jpeg))/i).captures > puts matchdata.size > > size prints me "1". > > am i capturing wrong? use text.scan() which matches all occurences p text.scan(/(https?:(?:\/*\w*\.*-*)*(?:\.gif|\.jpg|\.bmp|\.png|\.jpeg))/im) => [["http://sub-domain.domain.net/path/folder/figurename1010.jpg"], ["http://sub-domain.domain.net/path/folder/thum/figurename1010-thumb.jpg"]] -- Posted via http://www.ruby-forum.com/.