Merge pull request #13 from misol/db-search-operator

정규 표현식 다듬기
This commit is contained in:
Min-Soo Kim 2020-12-27 20:59:29 +09:00 committed by GitHub
commit 30402cb543
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -450,7 +450,7 @@ class VariableBase
// parse the value (text);
$value = str_replace('"', '"', $value);
$keywords = preg_split('/(\([^\)]*\))|(\-?\"[^\"]*\")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE);
$keywords = preg_split('/(\([^\)]*?\))|(\-?\"[^\"]*?\")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE);
$conditions = array();
$operators = array('AND', 'OR', '|');
// loop the parsed keywords or operators