I am trying to get this regex to match (once or twice) any occurrence of these strings: border-box|padding-box|content-box
Here is the regex:
((?:border-box|padding-box|content-box){1,2})
Here is the sample string:
background: url("my image.jpg") left right 2px 50% 75% repeat-x round scroll border-box padding-box;
Expected result:
border-box padding-box
Actual result:
Array
(
[0] => border-box
[1] => border-box
)
Oh and btw I am using this site to test my regex: http://www.phpliveregex.com/ Note: I am using preg_match not preg_match_all