penlooktmp / css-analyser

CSS Analyser
0 stars 0 forks source link

Analys DOM tree #2

Open loint opened 10 years ago

loint commented 10 years ago

Parse HTML and analys selector (tag, class, id) are used

tinntt commented 10 years ago

Complete analys selector (tag, class, id) Analys tag use this regex: <[A-za-z0-9]+ Analys id use: id=\"[A-Za-z0-9-\s]+\" Analys class use: class=\"[A-Za-z0-9-\s]+\" And the last one, to get the name of they i use: (class|\"|=|<|id)/ to replace all character is not necessary (ex: id, =, ",...). The result is 3 array $class_blocks, $id_blocks, $tag_blocks. Please check it @loint