From: James Edward Gray II Date: 2006-02-13T01:57:22+09:00 Subject: Re: Cutting a piece of text On Feb 12, 2006, at 10:18 AM, Zdebel wrote: > Helo ! > I've started to learn ruby and I'm amazed with it. Now I have a > problem > that I can't solve. If I have a string like this: > " Lalalalala " how > can I > cut the " artist=XXX album=XXX title=XXX" part, so it would look like: > " Lalalalala " Could you please help me ? You can do it with a regular expression like the following, but I must stress that this isn't very robust: >> " Lalalalala ".sub (/<(\w+)[^>]+>/, "<\\1>") => " Lalalalala " Hope that helps. James Edward Gray II