diff --git a/HTMLParser.Example/Global.asax b/HTMLParser.Example/Global.asax
new file mode 100644
index 0000000..ef9bd06
--- /dev/null
+++ b/HTMLParser.Example/Global.asax
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="HTMLParser.Example.Global" Language="C#" %>
diff --git a/HTMLParser.Example/Global.asax.cs b/HTMLParser.Example/Global.asax.cs
new file mode 100644
index 0000000..de086e9
--- /dev/null
+++ b/HTMLParser.Example/Global.asax.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Security;
+using System.Web.SessionState;
+
+namespace HTMLParser.Example
+{
+ public class Global : System.Web.HttpApplication
+ {
+ protected void Application_Start(object sender, EventArgs e)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/HTMLParser.Example/HTMLParser.Example.csproj b/HTMLParser.Example/HTMLParser.Example.csproj
new file mode 100644
index 0000000..e0125cd
--- /dev/null
+++ b/HTMLParser.Example/HTMLParser.Example.csproj
@@ -0,0 +1,141 @@
+
+
+
+
+
+ Debug
+ AnyCPU
+
+
+ 2.0
+ {40A82F71-B960-46A7-ABFB-51624688A52A}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ HTMLParser.Example
+ HTMLParser.Example
+ v4.5.2
+ true
+
+
+
+
+
+
+
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ true
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\HTMLParser\bin\Release\netstandard1.4\HTMLParser.dll
+
+
+ ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Web.config
+
+
+ Web.config
+
+
+
+
+
+
+
+
+
+ Global.asax
+
+
+ Parsed.aspx
+ ASPXCodeBehind
+
+
+ Parsed.aspx
+
+
+
+
+
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+
+
+
+
+ True
+ True
+ 7207
+ /
+ http://localhost:7207/
+ False
+ False
+
+
+ False
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HTMLParser.Example/Parsed.aspx b/HTMLParser.Example/Parsed.aspx
new file mode 100644
index 0000000..eaeeab2
--- /dev/null
+++ b/HTMLParser.Example/Parsed.aspx
@@ -0,0 +1,32 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Parsed.aspx.cs" Inherits="HTMLParser.Example.Parsed" %>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HTMLParser.Example/Parsed.aspx.cs b/HTMLParser.Example/Parsed.aspx.cs
new file mode 100644
index 0000000..44963d0
--- /dev/null
+++ b/HTMLParser.Example/Parsed.aspx.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+using HTMLParser;
+using System.Text.RegularExpressions;
+
+namespace HTMLParser.Example
+{
+ public partial class Parsed : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+
+ protected void Button1_Click(object sender, EventArgs e)
+ {
+ ParserEx parse = new ParserEx();
+
+ this.ParsedUrl.InnerHtml = parse.ParseUrl(this.txtSource.Value);
+ this.parsedYoutube.InnerHtml = parse.ParseYoutube(this.txtSource.Value);
+ this.parsedUrlAndYoutube.InnerHtml = parse.ParseUrlAndYoutube(this.txtSource.Value);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/HTMLParser.Example/Parsed.aspx.designer.cs b/HTMLParser.Example/Parsed.aspx.designer.cs
new file mode 100644
index 0000000..ba78948
--- /dev/null
+++ b/HTMLParser.Example/Parsed.aspx.designer.cs
@@ -0,0 +1,69 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace HTMLParser.Example {
+
+
+ public partial class Parsed {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// txtSource control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlTextArea txtSource;
+
+ ///
+ /// ParsedUrl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl ParsedUrl;
+
+ ///
+ /// parsedYoutube control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl parsedYoutube;
+
+ ///
+ /// parsedUrlAndYoutube control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl parsedUrlAndYoutube;
+
+ ///
+ /// Button1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button Button1;
+ }
+}
diff --git a/HTMLParser.Example/Properties/AssemblyInfo.cs b/HTMLParser.Example/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..143e476
--- /dev/null
+++ b/HTMLParser.Example/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HTMLParser.Example")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HTMLParser.Example")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("40a82f71-b960-46a7-abfb-51624688a52a")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/HTMLParser.Example/Web.Debug.config b/HTMLParser.Example/Web.Debug.config
new file mode 100644
index 0000000..fae9cfe
--- /dev/null
+++ b/HTMLParser.Example/Web.Debug.config
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HTMLParser.Example/Web.Release.config b/HTMLParser.Example/Web.Release.config
new file mode 100644
index 0000000..da6e960
--- /dev/null
+++ b/HTMLParser.Example/Web.Release.config
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HTMLParser.Example/Web.config b/HTMLParser.Example/Web.config
new file mode 100644
index 0000000..855dd25
--- /dev/null
+++ b/HTMLParser.Example/Web.config
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HTMLParser.Example/packages.config b/HTMLParser.Example/packages.config
new file mode 100644
index 0000000..b23732c
--- /dev/null
+++ b/HTMLParser.Example/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/HTMLParser.sln b/HTMLParser.sln
index 08212a9..7758c6f 100644
--- a/HTMLParser.sln
+++ b/HTMLParser.sln
@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.26403.7
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTMLParser", "HTMLParser\HTMLParser.csproj", "{0D713178-8D10-4521-BA52-DA3B3F5071CD}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTMLParser.Example", "HTMLParser.Example\HTMLParser.Example.csproj", "{40A82F71-B960-46A7-ABFB-51624688A52A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
{0D713178-8D10-4521-BA52-DA3B3F5071CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D713178-8D10-4521-BA52-DA3B3F5071CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D713178-8D10-4521-BA52-DA3B3F5071CD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {40A82F71-B960-46A7-ABFB-51624688A52A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {40A82F71-B960-46A7-ABFB-51624688A52A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {40A82F71-B960-46A7-ABFB-51624688A52A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {40A82F71-B960-46A7-ABFB-51624688A52A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/HTMLParser/Class1.cs b/HTMLParser/Class1.cs
deleted file mode 100644
index ecafacd..0000000
--- a/HTMLParser/Class1.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using System;
-
-namespace HTMLParser
-{
- public class Class1
- {
- }
-}
diff --git a/HTMLParser/ParserEx.cs b/HTMLParser/ParserEx.cs
new file mode 100644
index 0000000..3a03f2c
--- /dev/null
+++ b/HTMLParser/ParserEx.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Text.RegularExpressions;
+
+namespace HTMLParser
+{
+ public class ParserEx
+ {
+ public string ParseUrl(string article)
+ {
+ if (string.IsNullOrEmpty(article)) return string.Empty;
+
+ string Pttrn = @"(((http|https|ftp|telnet|news)://|www\.)[^youtube][a-z0-9-]+.[][a-zA-Z0-9:@=_~%;?/.+-]+)";
+ string Lnk = "$1";
+
+ return Regex.Replace(article, Pttrn, Lnk, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(150)).Replace("href=\"www.", "href=\"http://www.");
+ }
+
+ public string ParseYoutube(string article)
+ {
+ if (string.IsNullOrEmpty(article)) return string.Empty;
+
+ string pttrn = @"youtu(?:\.be|be\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]+)";
+ string script = "";
+
+ return Regex.Replace(article, pttrn, script, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(150)).Replace("https://