$re = '/(?P<NUMBER>[+-]?[0-9]+\.[0-9]+|-?\+?[\d]+)|(?P<LPAR>\()|(?P<RPAR>\))|(?P<NAME>%?\w\w*\-?>?\w*\!?\??\.? |[\+\-\.]+?)|(?P<BOOL>#t|#f|true|false)|(?P<STRING>^\"[\w].*[\w]*\")|(?P<CHAR>[#|\\\\a|\b|\\\\Backspace]+)|(?P<COMMENT>[;;].*$)|(?P<QUOTES>\'+|\"+)|(?P<OP>[\?==|<=|=|>=\-+*/<>])|(?P<IGNORE>[\s\t])/m';
$str = ';; Retorna a sequência de Collatz para o número dado
;; Argumento deve ser um número inteiro.
x ;; comentário
:defn collatz n:
:if [n = 1] then:
\'(+ 1 2)
#t
#f
true
false
"dsfsfsf-dfjsif"
-12.34
"(das)" \' \'
#
#
\\a #\\Backspace
(list 1)
:elif (even? n) then:
(cons n (collatz [n quotient 2]))
:else:
(cons n (collatz [[3 * n] + 1]))
;; Imprime a sequência de Collatz de 42';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php