System.Text.RegularExpressions.Regex.IsMatch C# (CSharp) Метод

IsMatch() публичный Метод

public IsMatch ( string input ) : bool
input string
Результат bool
        public bool IsMatch(string input)
        {
            throw null;
        }

Same methods

Regex::IsMatch ( string input, int startat ) : bool
Regex::IsMatch ( string input, string pattern ) : bool
Regex::IsMatch ( string input, string pattern, System options ) : bool
Regex::IsMatch ( string input, string pattern, System options, System matchTimeout ) : bool

Usage Example

Пример #1
1
        public override void DataSet(string myPath, string myPattern)
        {
            string[] fileList = Directory.GetFiles(myPath, myPattern, SearchOption.AllDirectories);

            Regex regexMov = new Regex(MovieContents.REGEX_MOVIE_EXTENTION, RegexOptions.IgnoreCase);
            Regex regexJpg = new Regex(@".*\.jpg$|.*\.jpeg$", RegexOptions.IgnoreCase);
            Regex regexLst = new Regex(@".*\.wpl$|.*\.asx$", RegexOptions.IgnoreCase);

            foreach (string file in fileList)
            {
                listFileInfo.Add(new common.FileContents(file, myPath));

                if (regexMov.IsMatch(file))
                    MovieCount++;
                if (regexJpg.IsMatch(file))
                    ImageCount++;
                if (regexLst.IsMatch(file))
                    ListCount++;

                if (regexJpg.IsMatch(file) && ImageCount == 1)
                    StartImagePathname = file;
            }
            ColViewListFileInfo = CollectionViewSource.GetDefaultView(listFileInfo);

            if (ColViewListFileInfo != null && ColViewListFileInfo.CanSort == true)
            {
                ColViewListFileInfo.SortDescriptions.Clear();
                ColViewListFileInfo.SortDescriptions.Add(new SortDescription("FileInfo.LastWriteTime", ListSortDirection.Ascending));
            }
        }
All Usage Examples Of System.Text.RegularExpressions.Regex::IsMatch