Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8958407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:12:23+00:00 2026-06-15T15:12:23+00:00

I wanna build a program to crawl some websites, check for the style.css file,

  • 0

I wanna build a program to crawl some websites, check for the style.css file, open it, and with a Regex which is #([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9])(?=;) I want to get the top 5 colors of the style.css

If there are 200 colors in my regex result, I wanna get the top 5 meaning.

For example my regex will find this color #ffffff 100 times, which means this will be my first color.

The color #343434 will be found 98 times, this will be my second color.

And so on to get the top 5 colors from the style.css file.

Any ideas on how to implement this ?

I found this sort of example on here:

var l1 = new List<int>() { 1,2,3,4,5,2,2,2,4,4,4,1 };

        var g = l1.GroupBy( i => i );

        foreach( var grp in g )
        {
           Console.WriteLine( "{0} {1}", grp.Key, grp.Count() );
        }

But it’s not really what I’m looking for.

Any ideas are welcome.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:12:24+00:00Added an answer on June 15, 2026 at 3:12 pm

    You can try something like:

    var topMatches = Regex.Matches(stringToCheck, RegExPattern)
        .Cast<Match>()
        .GroupBy(m => m.Value)
        .Select(m => new{ Colour = m.Key, Count = m.Count() })
        .OrderByDescending(g => g.Count)
        .Take(5)
        .ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna use powershell to get all the file in sharepoint library EM_DOC_LIBRARY and
I wanna build a console app that may stop and prompt for some input,
I am looking for some code as I don't really wanna get into the
I wanna build a gallery, but the my problem is how to load the
i wanna creat a website for downloading some files (pdf,word,xls, such as these files),
I wanna upload/update file by System.IO.FileStream in Google Documents List API(C#)? I use two
I wanna check sharepoint title first and see if the lib doesn't have that
I wanna get the string representation of a variable. For example, (def my-var {})
I wanna to detect an input tag that its name is: some[en] in jquery.
I wanna start with first program in PHP. I have got installed xampp and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.