Torna al Thread

(?:href="(?<url>[^"]*)")|(?:href='(?<url>[^']*)')|(?:src="(?<url>[^"]*)")|(?:src='(?<url>[^']*)') string ResultString = null; try { Regex RegexObj = new Regex("(?:href=\"(?<url>[^\"]*)\")|(?:href='(?<url>[^']*)')|(?:src=\"(?<url>[^\"]*)\")|(?:src='(?<url>[^']*)')", RegexOptions.IgnoreCase); ResultString = RegexObj.Match(SubjectString).Groups["groupname"].Value; } catch (ArgumentException ex) { // Syntax error in the regular expression }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5