#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Matching with no known order


    Hi!
    I'm trying to find styles in HTML-files which are already defined in a CSS-File.
    For example I want to find this:

    Code:
    float:left; margin:4px 0px 4px 4px; overflow:hidden; height:10px;
    Well, it doesn't matter in which order the attributes are in the HTML-Code, so this should match too:

    Code:
    height:10px; float:left; overflow:hidden; margin:4px 0px 4px 4px;
    I tried something like this:

    Code:
    (float:left; |margin:4px 0px 4px 4px; |overflow:hidden; |height:10px; )
    (float:left; |margin:4px 0px 4px 4px; |overflow:hidden; |height:10px; )
    (float:left; |margin:4px 0px 4px 4px; |overflow:hidden; |height:10px; )
    (float:left; |margin:4px 0px 4px 4px; |overflow:hidden; |height:10px; )
    The problem there is, that the Regex is getting too long for grep.

    Any ideas?
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    The problem there is, that the Regex is getting too long for grep.
    grep accepts an input file for the regular expression (if that's not true, awk does)
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0
    Originally Posted by ManiacDan
    grep accepts an input file for the regular expression (if that's not true, awk does)
    Well, for some reason it told me, that the Regex was too long. But nevermind, I went with

    Code:
    (float:left; |margin:4px 0px 4px 4px; |overflow:hidden; |height:10px; ){4}
    ;-) Pretty obvious :-D

IMN logo majestic logo threadwatch logo seochat tools logo