-
-
Save SpacePurr/81cebd74564c8f5d321dd6d9a02ac039 to your computer and use it in GitHub Desktop.
Stramge regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("°", "\xB0"); | |
answer += "Казань" + "\nТемпература воздуха: " + temp + "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment