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

Popular posts from this blog

haskell - Using filter on an item in a list? -

c# - When does PreApplicationStartMethod actually get triggered to run? -

tomcat6 - Exception when stopping container for a with Spring + Quartz + Tomcat web application -