From: kwatch@... (kwatch) Date: 2002-06-17T11:16:02+09:00 Subject: Q: n-times matching Hi, I wrote the following code, but I can't get an expeceted result. ..===================== nmatch.rb ======== str = 'hogeratta' while str =~ /<(\/?\w+)>/ do print $1, "\n" end ..======================================== Expected output: ..---------------------------------------- $ ruby nmatch.rb html body /body /html ..---------------------------------------- Real output: ..---------------------------------------- % ruby nmatch.rb html html html .... (infinite loop) ..---------------------------------------- Please tell me how to get what I expected. regards, makoto