Graeme Geldenhuys wrote: > Hi, > > I'm using the following regular expression: 'foob.*r' > Calling MatchString() against each of the items in the stringlist, I > expected it to match 3 items. Instead it only matches the first item > and fails all the rest. Why??? > > > --------------[ source code ]------------------- > sl := TStringList.Create; > sl.Add('1st foobr Item'); > sl.Add('2nd Item'); > sl.Add('3rd Item'); > sl.Add('4th foobaoeuaor Item'); > sl.Add('5th foobar Item'); > > r := TRegexEngine.Create('foob.*r'); > x := 0; > y := 0;
You should reset x, y within the loop (before each r.MatchString), not here. Michalis _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal