C# Using regex, how to find a language in url -


I have a class library to add a customized toolbox to an external IE browser. I am using SHDocVw to perform the Back / Forward Button (SG). My question is, it's multilingual, how can I change the button text ... URL gives me "/ n /" or "/ ar /", how can I catch it? Thanks

With clay cicero answer I am able to do it.

string page = i.e. Location URL; Reggaez RGX = New Reggae (@ "https ?: // [a-zA-Z0-9. -_] + (/ (('' langar | n) |. * *)) /?");

var lang = rgx.Match (page). Success? Rgx.Match (page). group 1]. Price: "AR";

You can try the following regex, I tried to make it as common as I could :

  https ?: \ / \ / [a-zA-Z0-9 \. \ -_] + (\/((?'lang'es|en)|.*))\/?  

You can check the "lang" group to see if you make a match.

Languages ​​you want to add more available (in ch and ):

  https?: \ / \\[[-ZA-Z0-9\.-)-( )) \ /?  

Comments