Link to home
Start Free TrialLog in
Avatar of Supriya Pawar
Supriya Pawar

asked on

to understand this code.

HttpWebResponse response = null;

                try { response = request.GetResponse() as HttpWebResponse; }

                catch (WebException) { return null; }



                // Regular expression for an HTML title

                string regex = @"(?<=<title.*>)([\s\S]*)(?=</title>)";

Open in new window


i want to understand what this do?
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

        string regex = @"(?<=<title.*>)([\s\S]*)(?=</title>)";

Open in new window


This regex will match anything(Including whitespace and anything that is not whitespace) that is entered between <title> tag of a web page.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.