From: brabuhr@... Date: 2010-12-15T06:33:32+09:00 Subject: Re: Need Help with Split On Tue, Dec 14, 2010 at 2:05 PM, A. Mcbomb wrote: > I have a list of records that need to be split between the address and > the city. Here is some of the data: > > If I could find a way to split where a lower case letter butts directly > against an Upper case letter, that might be a good start. /tmp$ cat i.rb s = <-16 Bonner StreetHartford,-CT -450 Main StreetHartford,-CT -812 Farmington AvenueWest Hartford,-CT -25 Forest Street No. 18Stamford,-CT -25 Forest Street No. 6AStamford,-CT -1450 Main StreetBridgeport,-CT END require 'pp' pp s.scan(/-(.*?[a-zA-Z\d])([A-Z][a-z].*)/) /tmp$ ruby i.rb [["16 Bonner Street", "Hartford,-CT"], ["450 Main Street", "Hartford,-CT"], ["812 Farmington Avenue", "West Hartford,-CT"], ["25 Forest Street No. 18", "Stamford,-CT"], ["25 Forest Street No. 6A", "Stamford,-CT"], ["1450 Main Street", "Bridgeport,-CT"]]