From: domingo@... (Domingo Alvarez Duarte) Date: 2003-08-22T01:54:13+09:00 Subject: Re: Strscan ruby 1.8 why this doesn't work ? nobu.nokada@softhome.net wrote in message news:<200308191153.h7JBrIb7031508@sharui.nakada.kanuma.tochigi.jp>... > Hi, > > At Tue, 19 Aug 2003 20:03:28 +0900, > Domingo Alvarez Duarte wrote: > > I have been using strscan till version 0.65 and it was working with a > > code like this but now trying to upgrade to ruby 1.8 it doesn't, is > > there a bug in strscan or I misunderstood it ? > > StringScanner has the "cursor" internally, and always tries > matching at the position. In other words, it never skip > unmatched portion. > > > SSI_search_re = /|\[\)(.+?)\(\]/m > > res = parse('Hello > > [)Domingo(] !') > > This string doesn't start with the part matches to the RE. > > SSI_search_re = /.*?(?:|\[\)(.+?)\(\])/m > > may works but I'm not sure if it is what you really want. No it's not that, I think it should try match the whole string and not only if it starts with the regular expression and as I told and you can try it works with strscan version 6.5 but not with 6.7 as well, I couldn't find any documentation that try explain how it should work in ruby 1.8.