1 write to Regex
Microsoft.Build (1)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
37Regex = regex;
32 references to Regex
Microsoft.Build (2)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (2)
45return Regex.IsMatch(s); 48var match = Regex.Match(s);
Microsoft.Build.BuildCheck.UnitTests (30)
EditorConfig_Tests.cs (30)
124Assert.Equal("^.*/abc$", matcher.Regex.ToString()); 136Assert.Equal("^.*/[^/]*$", matcher.Regex.ToString()); 147Assert.Equal("^.*/[^/]*\\.cs$", matcher.Regex.ToString()); 164Assert.Equal("^.*/.*\\.cs$", matcher.Regex.ToString()); 174Assert.Equal("^.*/\\.\\.\\.$", matcher.Regex.ToString()); 194Assert.Equal("^.*/ab.def$", matcher.Regex.ToString()); 207Assert.Equal("^.*/ab\\\\c$", matcher.Regex.ToString()); 218Assert.Equal("^.*/\\*.*\\*\\*[^/]*$", matcher.Regex.ToString()); 230Assert.Equal("^.*/\\?.\\?[^/]*\\?.$", matcher.Regex.ToString()); 244Assert.Equal(@"^.*/abc\{}def$", matcher.Regex.ToString()); 256Assert.Equal("^.*/abc,def$", matcher.Regex.ToString()); 269Assert.Equal("^.*/[^/]*\\.(?:cs|vb|fs)$", matcher.Regex.ToString()); 299Assert.Equal("^/(?:[^/]*\\.cs|subdir/test\\.vb)$", matcher.Regex.ToString()); 313Assert.Equal("^.*/(?:)$", matcher.Regex.ToString()); 325Assert.Equal("^.*/(?:[^/]*\\.cs)$", matcher.Regex.ToString()); 351Assert.Equal("^.*/(?:test(?:\\.cs|\\.vb)|other\\.(?:a(?:bb|cc)))$", matcher.Regex.ToString()); 371Assert.Equal("^.*/ab(?:-)cd(?:-|)ef$", matcher.Regex.ToString()); 385Assert.Equal("^.*/ab(?:cs|vb|fs)cd$", matcher.Regex.ToString()); 505Assert.Equal(@"^.*/[^/]*\.[cf]s$", matcher.Regex.ToString()); 516Assert.Equal(@"^.*/[^/]*\.[^cf]s$", matcher.Regex.ToString()); 529Assert.Equal(@"^.*/[^/]*\.[\^cf]s$", matcher.Regex.ToString()); 543Assert.Equal("^.*/[0-9]x$", matcher.Regex.ToString()); 556Assert.Equal("^.*/[^0-9]x$", matcher.Regex.ToString()); 569Assert.Equal("^.*/[ab0-9]x$", matcher.Regex.ToString()); 614Assert.Equal(@"^.*/[\[a]bc$", matcher.Regex.ToString()); 629Assert.Equal(@"^.*/[-ac]bd$", matcher.Regex.ToString()); 644Assert.Equal(@"^.*/[ac-]bd$", matcher.Regex.ToString()); 658Assert.Equal(@"^.*/[ab]]cd$", matcher.Regex.ToString()); 673Assert.Equal(@"^.*/[ab\\]cd$", matcher.Regex.ToString()); 686Assert.Equal(@"^.*/ab\[cd$", matcher.Regex.ToString());