From: Johnathan Smith Date: 2007-12-07T00:42:43+09:00 Subject: regular expression. newbie problem. Hi, i know this is a pretty basic problem but im a newbie so any help would be greatly appreciated im trying to write a name class one which returns a first name a surname, first and second initials however, i realise i regular expression is needed to go through the name to produce the correct output. however im unsure of whaty regular expression to use and whether my class is looking correct in general anyhelp would be greatly appreciated thanks name class: class Name def initialize(name) @fname = name.slice!(rexesp) @sname = name.slice!(regexp) @mname = name.slice!(regexp) def firstname return @fname end def surname return @sname end def firstinitial return @finitial end def firstinitial return @sinitial end -- Posted via http://www.ruby-forum.com/.