mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-09-12 01:05:21 +00:00
- slim/slim: ^3.1 - symfony/expression-language: ^3.4 - fxp/composer-asset-plugin: ~1.3 - bower-asset/vue: ^2.5 - bower-asset/vue-resource: ^1.5
23 lines
828 B
PHP
23 lines
828 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
$operators = array('not', '!', 'or', '||', '&&', 'and', '|', '^', '&', '==', '===', '!=', '!==', '<', '>', '>=', '<=', 'not in', 'in', '..', '+', '-', '~', '*', '/', '%', 'matches', '**');
|
|
$operators = array_combine($operators, array_map('strlen', $operators));
|
|
arsort($operators);
|
|
|
|
$regex = array();
|
|
foreach ($operators as $operator => $length) {
|
|
// an operator that ends with a character must be followed by
|
|
// a whitespace or a parenthesis
|
|
$regex[] = preg_quote($operator, '/').(ctype_alpha($operator[$length - 1]) ? '(?=[\s(])' : '');
|
|
}
|
|
|
|
echo '/'.implode('|', $regex).'/A';
|