개발자의 금승훈의 지식베이스 입니다.

정규식 모음

ETC.2012.03.26 10:55
padding, margin, border 추출
(padding|margin|border)[ ]*:[ ]*([0-9]+)[ ]?([0-9]+)[ ]?([0-9]+)[ ]?([0-9]+)[ ]?([\"|\' |>|;]+)
\1:\2px \3px \4px \5px\6


border-width추출
(border-width)[ ]*:[ ]*([0-9]+)[ ]?([0-9]+)[ ]?([0-9]+)[ ]?([0-9]+)[ ]?([\"|\' |>|;]+)
\1:\2px \3px \4px \5px\6


((padding|margin|border|width|height)(-left|-right|-top|-bottom)?)[ ]?:[ ]?([0-9]+)[ ]?([\"|\' |>|;]+)
\1:\4px\5

(height|width|border)[ ]?=[ ]?([\'|"]?)([0-9]+)([\'|"]?)([ |>]+)
\1=\2\3px\4\5

([\"|\' |=|:| ]+)(0px)
\10


(bgcolor|background)[ ]?=[ ]?([\'|"]?)([^#]?)([0-9a-zA-Z])
\1=\2#\3\4

 

(padding|margin|border)(-left|-right|-top|-bottom)?([ ]?)(\:)+([ ]?)([0-9]+)([ ]?)([0-9]+)([ ]?)([0-9]+)([ ]?)([0-9]+)

((style)([ ]?)(=)([ ]?))(.*)([0-9]+)([;|\""|\']) 

Comment +0