match - need help with regex -
in string
mssql://text1:text2@text3/text4?applicationname=adfdgfshg
i need match
text1:text2@text3
and
text4
i wrote:
string connectionurl = "mssql://faerg:aassd@4235453tgr/he657i7u8kui?applicationname=adfdgfshg"; match m = regex.match(connectionurl, "mssql\\s*:\\s*//\\s*([\\d\\w\\s]*)/([\\d\\w\\s]*)\\?");
but didn't match anything. appreciated :) .
^mssql://([^/]+)/([^?]+)\?
tested , tru on rubular (needs escaping on /
). unfortunately, not able create permalink :(
Comments
Post a Comment