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

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -