Skip to content

Instantly share code, notes, and snippets.

@SpacePurr
Created May 2, 2020 20:49
Show Gist options
  • Save SpacePurr/81cebd74564c8f5d321dd6d9a02ac039 to your computer and use it in GitHub Desktop.
Save SpacePurr/81cebd74564c8f5d321dd6d9a02ac039 to your computer and use it in GitHub Desktop.
Stramge regex
string town = new Regex(@"<h1>(?<town>.*)</h1>").Match(data).Groups["town"].Value;
string temp = new Regex(@"<div class=""temperature"">([^<]+)<span class=""value "">(?<temp>[^<]+)</span>").Match(data).Groups["temp"].Value.Replace("&deg;", "\xB0");
answer += "Казань" + "\nТемпература воздуха: " + temp + "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment