On 2013-Dec-18, at 04:23 , Joel Pearson <lists / ruby-forum.com> wrote:

> Use "sub", and the non-greedy operator: "?"
> 
> "M.raja.gopalan".sub(/(.*?)\./,'')
> 
> -- 
> Posted via http://www.ruby-forum.com/.

Alternatively, you could match all non-. characters up to the first . using:

"M.raja.gopalan".sub(/\A[^.]*\./,'')

\A anchors the match to the beginning of the string
[^.] matches any character that isn't a .

irb2.0.0> "M.raja.gopalan".sub(/\A[^.]*\./,'')
#2.0.0 => "raja.gopalan"


-Rob