From: Robert Klemme Date: 2005-07-06T15:40:45+09:00 Subject: Re: Extract/Parse String? Assaph Mehr wrote: > Use regular expressions > (http://www.ruby-doc.org/docs/ProgrammingRuby/html/intro.html#S5), > then #scan the string for something that matches. Eg. assuming the > format is always 'treeframe' followed by digits: > > irb(main):038:0> c.scan /treeframe\d+/ > => ["treeframe1120266500902"] > > You'll get an array with all the results. If you know you have only > one occurence you can use String#slice (or String#[]) to get the first > value: > > irb(main):037:0> c[/treeframe\d+/] > => "treeframe1120266500902" > > HTH, > Assaph Although that'll work for this particular string, I'd rather think this is a case for a HTML parser. Apparently the name of a frame is wanted and a HTML parser is the safest way to get that info. Kind regards robert