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

  • SEARCH
  • Home
  • 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 5948035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:02:58+00:00 2026-05-22T17:02:58+00:00

I have a problem with regular expression, I need a regular expression to read

  • 0

I have a problem with regular expression, I need a regular expression to read classes names with properties and the same thing with IDs and Tags styling, each match must have one block; class name (or classes names) with their style!

To explain my problem, the regular expression must match the following syntax of styling:

#myId {
    margin: 10px 8px 9px 0;
}

.myClass1 {
    margin: 10px -8px 9px 0;
    padding: 10px 8px 9px 0;
}

-my-tag {
    margin-down     :-10px;
    margin-left: 10px;
    margin-right: 10px;
}

-my-tag #my-id{
    margin-down     :-10px;
    margin-left: 10px;
    margin-right: 10px;
}
#_myI4D6 {margin:10px;}

.myclass.myclass_too {
}
.myclass .myclass_too {                                
    margin-up:10px;
    bac: url "(../../image/p_n-G.png)";
    Margin: 10px 0 10PX 10Px;
    }

#myID .myclass:first-child my-tag {
     margin:     10px;
}

.emptyclass {
}
.classname 
tagnam {
  padding: 40px 999px        ; 
}

.className #myid
{
    maRgin: 10px 0 10px 10px;
}

the first match must be :

#myId {
        margin: 10px 8px 9px 0;
    }

On advanced if you can solve the comment problem, maybe class commented like:

/* #myId {
        margin: 10px 8px 9px 0;
    } */

I don’t need to match it.

Note: I write a program using C#, and please note white spaces problems too (Tabs, newlines and spaces).

  • 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-05-22T17:02:59+00:00Added an answer on May 22, 2026 at 5:02 pm

    It seems like you’re trying to implement CSS parsing in C#. I can’t help you with the regex, but I would strongly suggest you avoid implementing such a thing yourself and use an existing CSS parsing library and save yourself tons of efforts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one interesting problem. I must parse mail body (regular expression), get some
I have a problem with regular expressions! How can i count html tags with
I'm having a problem writing a regular expression for matching HTML tags. I found
How I can create a regular expression for the following problem: I have a
I have been trying to solve a PHP regular expression problem for awhile now
I have a problem where scrolling in both a toolStripComboBox and regular ComboBox is
I have problem with return statment >.< I want to store all magazine names
I have the following text: abcabcabcabc<2007-01-12><name1><2007-01-12>abcabcabcabc<name2><2007-01-11>abcabcabcabc<name3><2007-02-12>abcabcabcabc<name4>abcabcabcabc<2007-03-12><name5><date>abcabcabcabc<name6> I need to use regular expressions in order
I'm having some issues with a regular expression I'm creating. I need a regex
I need a Javascript regular expression that scans a block of plain text 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.