tags:

views:

52

answers:

1

I have one HTML file which contains the following:

.CLASS1 {
 font-family: Arial, Helvetica, sans-serif;
 font-size: 18px;
}
.style1 {
 font-family: Arial, Helvetica, sans-serif;
 font-size: 18px;
}
.style4 {
 font-size: 12px;
 font-weight: bold;
 font-family: Arial, Helvetica, sans-serif;
}
.style6 {font-family: Arial, Helvetica, sans-serif}
.style7 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.style13 {font-size: 20px}
.style14 {
 font-size: 22px;
 font-weight: bold;
}
.style15 {font-family: Arial, Helvetica, sans-serif; font-size: 20px; }
.style16 {
 font-size: 15px;
 font-weight: bold;
}
.style18 {font-size: 13px}
.style20 {font-size: 13px; font-family: Arial, Helvetica, sans-serif; }
.style24 {font-family: Arial, Helvetica, sans-serif; font-size: 20px; font-weight: bold; }
.style26 {font-size: 15px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; }
.style27 {font-size: 14px}
.style32 {font-size: 13px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.style33 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.style34 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; } 

I want list in C# that contains

style1
style3
style34
..
..
..
in this manner ..

Thanks in advance.

A: 

Might want to have a look at this question: http://stackoverflow.com/questions/512720/is-there-a-css-parser-for-c

If that doesn't do it you should be able to write a fairly simple one using regex to parse it. E.g.

  1. Remove all whitespace.
  2. look for (.*)\{
Rob Stevenson-Leggett