preg_match_all and css



Hello,

I'm trying to parse out the properties of a class definition from a css
file and am running into issues trying to write the reg. expression:

h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
color: #003399;
}
....

I need the results in:
array[i][0] = "h1"
array[i][1] = "
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
color: #003399;"

Any idea? I tried looking online for an example and can't find anything
that works with php's preg_match_all() function...

Thank you in advance!

-Kevin

.



Relevant Pages

  • phps preg_match_all() and css classes...
    ... I'm trying to parse out the properties of a class definition from a css ... file and am running into issues trying to write the reg. ...
    (comp.lang.php)
  • Re: Read a CSS File
    ... I already managed to parse out the classes I need and apply ... > support for processing css file or the css format data. ... > #CSS Custom Provider To extend Web Control's Property Window ... > Microsoft Online Support ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: C parsing fun
    ... When I came up with this idea on how to parse C files with ease, ... realized that bracketed code is almost like a Python list, ... only pure string manipulations so I believe it's really fast. ... For example when I need to parse a class definition, ...
    (comp.lang.python)
  • Re: having a special stylesheet for 800x600
    ... needed to programatically modify some CSS, I'd parse the stylesheet into ... some sort of object structure, tweak the objects and then re-serialise ... back to CSS. ...
    (comp.lang.php)
  • Re: What does "font:13px/1.231" syntax mean?
    ... I can't find an example of that in the CSS ... spec. ... Team OS/2 ** Reg. ...
    (comp.infosystems.www.authoring.stylesheets)