From: RichardOnRails Date: 2007-11-21T10:24:59+09:00 Subject: Re: False positives in editing data On Nov 20, 10:22 am, Harry Kakueki wrote: > > Hi Ryan, > > > > But, just in case you are interested in looking at it from a little > > > different view.... > > > It is not a complete solution, just an idea. > > > I AM interested, and it's a great idea. Real Ruby rather than my C- > > flavored Ruby :-) > > > Just for our mutual amusement, I replaced your first criterion: > > > err1 = inp.select{|a| a =~ /^0|\.0/} > > > with: > > > err1 = inp.select{|a| a =~ /^0|^\d*\.0/} > > > to preclude false hits where the text proper might contain ".0", e.g., > > "7How to get 5.05% interest" > > > Bottom line: Your code is what I really need. Thanks, again. > > > Best wishes, > > Richard > > Yeah, you need to modify the regular expressions and whatever to fit > your requirements. > Like I said, it's not a complete solution, just an idea you can use. > > By the way, stop calling me Shirley. :) > And stop calling me Ryan. :) > > Good luck, > > Harry > > -- > A Look into Japanese Ruby List in Englishhttp://www.kakueki.com/ruby/list.html Hi Harry, I apologize for the "Ryan" thing. Ryan was the first response on this thread and got mixed up. I don't know about the "Shirley" thing. I don't know what's going on there, but I apologize again for any way I might have erred. And I fear I owe you a third apology: I minute ago, I started to reply to your most recent post when I stopped getting a timely response to my typing. I continue to type, assuming my ISP would catch up sooner or later and hit Enter. Suddenly, I got a message that my half-baked response had been posted. Computers: uggggh! > Like I said, it's not a complete solution, just an idea you can use. I know. I just wanted to show you I was giving my full attention to your message. Again, thanks for showing how Ruby can be used more effectively for this kind of validation task. Best wishes, Richard