> With Perl, something like
>  while (/regexp/g) {
> 	#do smt with $1
> }
> works.
> 
> How can I do that with Ruby ?

Maybe with
	string.scan(/regexp/) { |match|
		# do something with match
	}
.