- preg_match: documentation ( source)
<?php
$string = 'a{ra:calc(*(la)100%);font-s';
$string_regex = '((?<!\\\\)(?:\\\\\\\\)*(\'|")(?:.*?[^\\\\])??(?:\\\\\\\\)*\\2)';
$comment_regex = '(\\/\\*(?:(?!\\*\\/).)*\\*\\/)';
$url_regex = '(?<=:| |,|\\(|\\))(url|calc)\\s*(\\()\\s*((?:[^()]+|(?2))*?)\\s*(\\))';
$string = preg_match('/'.$string_regex.'|'.$comment_regex.'|'.$url_regex.'|'.$calc_regex.'/si', $string, $matches);