B
Berlin Brown
I am trying to convert a regex expression that I have in ruby to do the
same in java, but the dialects are different.
I am trying to parse a URL such that I get the domain name (possibly
with the www).
http://www.yahoo.com/suckit/kjlaflaj/ljl?lsklf"
For example, above would return:
www.yahoo.com
My ruby regex expression is such that:
/^(?:[^\/]+:\/\/)?([^\/:]+)/
And I was working on the java one, havent made much progress:
p = Pattern.compile("^http://([a-z0-9]*\.)*")
m = p.matcher( String("http://www.yahoo.com/suckit/kjlaflaj/ljl?lsklf")
)
same in java, but the dialects are different.
I am trying to parse a URL such that I get the domain name (possibly
with the www).
http://www.yahoo.com/suckit/kjlaflaj/ljl?lsklf"
For example, above would return:
www.yahoo.com
My ruby regex expression is such that:
/^(?:[^\/]+:\/\/)?([^\/:]+)/
And I was working on the java one, havent made much progress:
p = Pattern.compile("^http://([a-z0-9]*\.)*")
m = p.matcher( String("http://www.yahoo.com/suckit/kjlaflaj/ljl?lsklf")
)