From: Liu Lantao Date: 2009-12-01T22:47:34+09:00 Subject: Re: one more regular expression, please --00151773e6bada2d040479aaff14 Content-Type: text/plain; charset=UTF-8 extractor = Regexp.new('\+\+\(\((\d+)\)\)\+\+') extractor.match will extract all the ++(123)++ like parts and extract all 123s into an array, if the string start with ++, try ^\+\+\(\((\d+)\)\)\+\+ On Tue, Dec 1, 2009 at 10:07 AM, J. mp wrote: > Hi, > > I really can't figure out how regular expressions work, and since I > don't use them frequently is easier to ask... > > I have the follwow string > > ++((100))++askjasdjksjdkasdkjk++((200))++skdjsjd > > I need a reg expression that extracts only the first number inside the > first ++(( ))++ and ignore the rest..., in this case I need to return > 100 > > > thanks > -- > Posted via http://www.ruby-forum.com/. > > -- Liu Lantao College of Information Science and Technology, Beijing Normal University EMAIL: liulantao ( at ) gmail ( dot ) com ; WEBSITE: http://www.liulantao.com/ . ------ --00151773e6bada2d040479aaff14--