From: "francisrammeloo@..." Date: 2005-07-30T17:06:02+09:00 Subject: Re: Chopping the beginning of a string elegantly I'm sorry but my first post was misleading. The string actually looks like this: " BeginCaption 0, 20, 66, .." (the whitespace can be a combination of tabs and spaces) So I actually have to cut out "Caption" word in the <> of the string. Brian's hint got me on the right track. The solution I finally found was: pane = line.sub(/\s*Begin(\w+).*/, '\1') Unless some expert can prove a still more tight solution I believe I have found the best way to cut out the "Caption" part of the string. Thank you all for your help. Best regards, Francis