154 references to Regex
aspire (2)
Utils\MarkdownToSpectreConverter.cs (2)
169var regex = new Regex(@"^>\s*(.*)$"); 215var spectreRegex = new Regex(spectrePattern);
Aspire.Dashboard (1)
Components\Layout\MobileNavMenu.razor.cs (1)
45LinkMatchRegex: new Regex($"^{DashboardUrls.ResourcesUrl()}(\\?.*)?$")
Aspire.Dashboard.Tests (1)
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
47var tasks = testEndpoints.WaitForTexts.Select(x => app.WaitForTextAsync(log => new Regex(x.Pattern).IsMatch(log), x.ResourceName)).ToArray();
Aspire.Templates.Tests (1)
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
dotnet (34)
Commands\Test\MTP\Terminal\AnsiDetector.cs (17)
20new("^xterm"), // xterm, PuTTY, Mintty 21new("^rxvt"), // RXVT 22new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 23new("^screen"), // GNU screen, tmux 24new("tmux"), // tmux 25new("^vt100"), // DEC VT series 26new("^vt102"), // DEC VT series 27new("^vt220"), // DEC VT series 28new("^vt320"), // DEC VT series 29new("ansi"), // ANSI 30new("scoansi"), // SCO ANSI 31new("cygwin"), // Cygwin, MinGW 32new("linux"), // Linux console 33new("konsole"), // Konsole 34new("bvterm"), // Bitvise SSH Client 35new("^st-256color"), // Suckless Simple Terminal, st 36new("alacritty"), // Alacritty
Commands\Test\VSTest\TestCommand.cs (17)
671new("^xterm"), // xterm, PuTTY, Mintty 672new("^rxvt"), // RXVT 673new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 674new("^screen"), // GNU screen, tmux 675new("tmux"), // tmux 676new("^vt100"), // DEC VT series 677new("^vt102"), // DEC VT series 678new("^vt220"), // DEC VT series 679new("^vt320"), // DEC VT series 680new("ansi"), // ANSI 681new("scoansi"), // SCO ANSI 682new("cygwin"), // Cygwin, MinGW 683new("linux"), // Linux console 684new("konsole"), // Konsole 685new("bvterm"), // Bitvise SSH Client 686new("^st-256color"), // Suckless Simple Terminal, st 687new("alacritty"), // Alacritty
dotnet-svcutil-lib (8)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
557new Regex(@"(^(.*)(\(([0-9]+),([0-9]+)\)): )(error|warning) ([A-Z]+[0-9]+) ?: (.*)"); 559new Regex(@"(error|warning) ([A-Z]+[0-9]+) ?: (.*)");
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (1)
543s_outputReg = new Regex(@"^([^(]*)\(?([0-9]*)\)? ?:? ?(error|warning) ([A-Z]+[0-9]+) ?: ((.|\n)*)");
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
18private static Regex s_regex = new Regex("([(][(](?<t>[^)]+)[)])?(?<a>[^[]+)[[](?<ia>.+)[]][)]?"); 20private static Regex s_regex2 = new Regex("[(][(](?<cast>[^)]+)[)](?<arg>[^)]+)[)]");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (1)
75regex = new Regex(pattern);
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
103s_decodeCharPattern = new Regex("_[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_"); 212s_encodeCharPattern = new Regex("(?<=_)[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_");
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
ILCompiler.Compiler (1)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
ILCompiler.ReadyToRun (1)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
illink (1)
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.Build (1)
Definition\ToolsetReader.cs (1)
193var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Microsoft.Build.Framework (17)
Logging\AnsiDetector.cs (17)
18new("^xterm"), // xterm, PuTTY, Mintty 19new("^rxvt"), // RXVT 20new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 21new("^screen"), // GNU screen, tmux 22new("tmux"), // tmux 23new("^vt100"), // DEC VT series 24new("^vt102"), // DEC VT series 25new("^vt220"), // DEC VT series 26new("^vt320"), // DEC VT series 27new("ansi"), // ANSI 28new("scoansi"), // SCO ANSI 29new("cygwin"), // Cygwin, MinGW 30new("linux"), // Linux console 31new("konsole"), // Konsole 32new("bvterm"), // Bitvise SSH Client 33new("^st-256color"), // Suckless Simple Terminal, st 34new("alacritty"), // Alacritty
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.CodeStyle (3)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.Features (6)
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr); 640else if (relativePath.IsEmpty() && new Regex(fileName).IsMatch(relativePath))
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.Data.Analysis.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.DotNet.Build.Manifest (1)
BuildModelFactory.cs (1)
62private readonly Regex LegacyRepositoryUriPattern = new Regex(
Microsoft.DotNet.Build.Tasks.Installers (2)
src\CreateWixBuildWixpack.cs (1)
230var regex = new Regex(@"<\?define\s+(\w+)\s*=\s*""([^""]*)""\s*\?>");
src\GenerateCurrentVersion.cs (1)
97Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\UsagePattern.cs (1)
43return new Regex("");
src\WriteBuildOutputProps.cs (1)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.Extensions.AI.Evaluation (2)
Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Console (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Reporting (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Safety (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.ML.Data (1)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
Microsoft.ML.GenAI.LLaMA (1)
LlamaTokenizerHelper.cs (1)
52var preTokenizer = new RegexPreTokenizer(new Regex(_re), _specialTokens);
Microsoft.ML.IntegrationTests (1)
ModelFiles.cs (1)
71Assert.Matches(new Regex(@"(\d+)\.(\d+)\.(\d+)(-[dev|ci|preview\.(\d+)\.(\d+)\.(\d+)]){0,1}"), line);
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.NET.Build.Containers (16)
ContainerHelpers.cs (1)
30private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
DigestUtils.cs (1)
30["sha256"] = new Regex(@"^[a-f0-9]{64}$"),
ImageBuilder.cs (1)
29internal static Regex aspnetPortRegex = new(@"(?<scheme>\w+)://(?<domain>([*+]|).+):(?<port>\d+)");
ReferenceParser.cs (13)
98public static readonly Regex DomainRegexp = new(domain); 104public static readonly Regex AnchoredDomainRegexp = new(anchored(domain)); 114public static readonly Regex TagRegexp = new(tag); 126public static readonly Regex anchoredTagRegexp = new(anchoredTag); 172public static readonly Regex DigestRegexp = new(digestPat); 182public static readonly Regex AnchoredDigestRegexp = new(anchored( 203public static readonly Regex NameRegexp = new(namePat); 218public static readonly Regex anchoredNameRegexp = new(anchoredName); 236public static readonly Regex ReferenceRegexp = new(referencePat); 250public static readonly Regex IdentifierRegexp = new(identifier); 264public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 276private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 290private static readonly Regex anchoredShortIdentifierRegexp = new(anchoredShortIdentifier);
Microsoft.NET.Sdk.StaticWebAssets.Tasks (3)
OverrideHtmlAssetPlaceholders.cs (3)
40internal static readonly Regex _assetsRegex = new Regex(@"""(?<fileName>[^""]+)#\[\.{fingerprint}\](?<fileExtension>[^""]+)"""); 42internal static readonly Regex _importMapRegex = new Regex(@"<script\s+type=""importmap""\s*>\s*</script>"); 44internal static readonly Regex _preloadRegex = new Regex(@"<link\s+rel=""preload""(\s+id=""(?<group>[^""]+)"")?\s*[/]?>");
Microsoft.TemplateEngine.Cli (1)
TemplateInvoker.cs (1)
152Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.TemplateEngine.Edge (1)
Mount\Archive\ZipFileDirectory.cs (1)
25Regex r = new Regex($"^{rx}$");
Microsoft.TemplateEngine.Utils (3)
InMemoryFileSystem.cs (3)
196Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 276Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 358Regex rx = new("^" + Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$");
Microsoft.VisualBasic.Core (4)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (4)
1204m_DelimiterRegex = New Regex(Builder.ToString(0, Builder.Length - 1)) 1206m_DelimiterWithEndCharsRegex = New Regex(Builder.ToString()) 1348m_BeginQuotesRegex = New Regex(pattern) 1473Private m_WhiteSpaceRegEx As Regex = New Regex("\s")
Microsoft.VisualStudio.TestPlatform.Common (1)
Utilities\RunSettingsProviderExtensions.cs (1)
99Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
Utility\TrxFileHelper.cs (1)
27private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
DataCollector\Common\FileHelper.cs (1)
15private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.Web.XmlTransform (3)
XmlTransforms.cs (3)
312s_dirRegex = new RegularExpressions.Regex(@"\G\{%(\s*(?<attrname>\w+(?=\W))(\s*(?<equal>=)\s*'(?<attrval>[^']*)'|\s*(?<equal>=)\s*(?<attrval>[^\s%>]*)|(?<equal>)(?<attrval>\s*?)))*\s*?%\}"); 324s_parentAttribRegex = new RegularExpressions.Regex(@"\G\$\((?<tagname>[\w:\.]+)\)"); 336s_tokenFormatRegex = new RegularExpressions.Regex(@"\G\#\((?<tagname>[\w:\.]+)\)");
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
sdk-tasks (1)
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
SuperFileCheck (2)
Program.cs (2)
79var regex = new System.Text.RegularExpressions.Regex(pattern); 90var invalidRegex = new System.Text.RegularExpressions.Regex(invalidFullLinePattern);
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (1)
113? new Regex(Pattern)
System.Private.Xml (1)
System\Xml\Schema\FacetChecker.cs (1)
367_derivedRestriction.Patterns.Add(new Regex(Preprocess(_regStr.ToString())));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
48Regex whitespaceRegex = new(@"\s");
tlens (1)
src\runtime\src\tools\illink\external\Mono.Options\Options.cs (1)
1177private readonly Regex ValueOption = new Regex(