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