修复正则表达式匹配的问题，即使按照长度递减排序，还是会出现以下问题：

<pre>
foooo|f.*t 匹配 fooooot 出错，原因是 fooooot 匹配了 foooo 之后，会将 fooo 和数据进行匹配，但是 foooo 的长度和 fooooot 的长度不一样
</pre>

因此此类对正则表达式进行头尾完全匹配

@author simon
@version 1.0.0
336636
private List<String> completionPattern(List<String> patterns) {
        List<String> result = new ArrayList<String>();
        for (String pattern : patterns) {
            StringBuffer stringBuffer = new StringBuffer();
            stringBuffer.append("^");
            stringBuffer.append(pattern);
            stringBuffer.append("$");
            result.add(stringBuffer.toString());
        }
        return result;
    }
725662
public function getRevKFSwitch(){
        if (isset($this->_receive['FromKfAccount']))     //原接入客服
            $array['FromKfAccount'] = $this->_receive['FromKfAccount'];
        if (isset($this->_receive['ToKfAccount']))    //转接到客服
            $array['ToKfAccount'] = $this->_receive['ToKfAccount'];
        if (isset($array) && count($array) > 0) {
            return $array;
        } else {
            return false;
        }
    }
733182
public function verifyNotify(){
        if(empty($_POST)) {//判断POST来的数组是否为空
            return false;
        }
        else {
            //生成签名结果
            $isSign = $this->getSignVeryfy($_POST, $_POST["sign"]);
            //获取支付宝远程服务器ATN结果（验证是否是支付宝发来的消息）
            $responseTxt = 'true';
            if (! empty($_POST["notify_id"])) {$responseTxt = $this->getResponse($_POST["notify_id"]);}

            //写日志记录
            //if ($isSign) {
            //	$isSignStr = 'true';
            //}
            //else {
            //	$isSignStr = 'false';
            //}
            //$log_text = "responseTxt=".$responseTxt."\n notify_url_log:isSign=".$isSignStr.",";
            //$log_text = $log_text.createLinkString($_POST);
            //logResult($log_text);

            //验证
            //$responsetTxt的结果不是true，与服务器设置问题、合作身份者ID、notify_id一分钟失效有关
            //isSign的结果不是true，与安全校验码、请求时的参数格式（如：带自定义参数等）、编码格式有关
            if (preg_match("/true$/i",$responseTxt) && $isSign) {
                return true;
            } else {
                return false;
            }
        }
    }
153782
async function handle(sofar) {
    //根据路由执行相关操作
    try{
        let rs = await sofar.facade.callFunc(sofar.msg.control, sofar.msg.func, sofar.socket.user, sofar.msg);
        sofar.fn(rs);
    }catch(e){
        sofar.fn({code: facade.const.ReturnCode.Error});

        console.error(e);
    }
}
1109859
public function error() {
        if($this->PDOStatement) {
            $error = $this->PDOStatement->errorInfo();
            $this->error = $error[1].':'.$error[2];
        }else{
            $this->error = '';
        }
        if('' != $this->queryStr){
            $this->error .= "\n [ SQL语句 ] : ".$this->queryStr;
        }
        // 记录错误日志
        trace($this->error,'','ERR');
        if($this->config['debug']) {// 开启数据库调试模式
            E($this->error);
        }else{
            return $this->error;
        }
    }
936038
public void analyze(AnalyzeContext context) {
		boolean bufferLockFlag = false;
		//处理英文字母
		bufferLockFlag = this.processEnglishLetter(context) || bufferLockFlag;
		//处理阿拉伯字母
		bufferLockFlag = this.processArabicLetter(context) || bufferLockFlag;
		//处理混合字母
		bufferLockFlag = this.processMixLetter(context) || bufferLockFlag;
		
		//判断是否锁定缓冲区
		if(bufferLockFlag){
			context.lockBuffer(SEGMENTER_NAME);
		}else{
			//对缓冲区解锁
			context.unlockBuffer(SEGMENTER_NAME);
		}
	}
156040
public static void main(String[] args) throws Exception {
		CWSTagger tag = new CWSTagger("./models/seg.m");	

		RLSeg rlseg = new RLSeg(tag,"./tmpdata/FNLPDATA/all.dict");

		tag.setDictionary(tempdict);

		System.out.println("\n处理文件：");
		String s4 = tag.tagFile("../example-data/data-tag.txt");
		System.out.println(s4);
		String[] toks = s4.split("\\s+");
		int newset = rlseg.update(toks);
		rlseg.close();

		tag.setDictionary(tempdict);

		System.out.println("\n处理文件：");
		String s = tag.tagFile("../example-data/data-tag.txt");
		System.out.println(s);


	}
398375
function showLog() {
  let errorLevel = 0;
  let totalErrors = 0;
  errors.forEach((error, i) => {
    totalErrors = i + 1;
    errorLevel = error.errorLevel || errorLevel;
    console.log(`${error.errorLevel ? '⛔' : '⚠'}  ${error.message}`);
    console.log(JSON.stringify(error.entries));
    console.log('*-------------------------*');
  });
  if (errorLevel) {
    throw `⚠ failed because of the ${totalErrors} error${totalErrors > 1 ? 's' : ''} above ⚠`;
  }
  return totalErrors;
}
98378
private T onBeforeUpdate(T entity) {
		// TODO 更新前的操作
		Class<?> cls = entity.getClass();
		String entityName = cls.getName();
		String idFieldName = getIdFieldName(cls);
		ID id = entity.getId();
		
		String indexName = DaoHelper.getExtendFieldName(cls, ExtendField.Index);
		String pathName = DaoHelper.getExtendFieldName(cls, ExtendField.Path);
		String parentName = DaoHelper.getExtendFieldName(cls, ExtendField.Parent);
		
		System.out.println(indexName + "," + pathName + "," + parentName);
		
		// 可记录时间的
		if (Dateable.class.isAssignableFrom(cls)) {
			((Dateable) entity).setLastModifiedDate(Calendar.getInstance().getTime());
		}
		
		// 可树形结构化的
		if (Treeable.class.isAssignableFrom(cls)) {
			// 判断自身位置有没有发生变化
			Treeable currObject = (Treeable) entity;
			Serializable newParentId = currObject.getParent();
			Treeable dbObject = (Treeable) getCurrentSession().get(cls, id);
			Serializable oldParentId = dbObject.getParent();
			
			System.out.println("newParentId:" + newParentId + " --> oldParentId:" + oldParentId);
			
			// 跨层级移动
			if( notNull(newParentId) && ( !newParentId.equals( oldParentId ) ) ){
				String oldPath = dbObject.getPath();
				Treeable newParent = (Treeable) getCurrentSession().get(cls, newParentId);
				String newPath =  newParent.getPath() + id.toString() + "/";
				currObject.setPath(newPath);
				
				System.out.println( "newPath:" + newPath + " --> oldPath:" + oldPath );
				
				//1.修改自身的排位
				Object maxVal = createCriteria(cls).add(Restrictions.eq(parentName, currObject.getParent())).setProjection(Projections.max(indexName)).uniqueResult();
				currObject.setIndex( isNull(maxVal) ? 1 : (Integer.valueOf(maxVal.toString()) + 1) );
				//2.如果自身的下级节点路劲：截取dbObject的path 换成	currentObject的path
				int subStart = oldPath.length() + 1;
				String hql = "update " + entityName + " set "+pathName+" = Concat(?, Substring( "+pathName+", "+subStart+", Length("+pathName+") )) where "+pathName+" like ?";
				getCurrentSession().createQuery(hql)
					.setParameter(0, newPath)
					.setParameter(1, oldPath +"_%")
					.executeUpdate();
			}
			// 同级之间移动
			else if( ! dbObject.getIndex().equals(currObject.getIndex()) ){
				// 更新目标节点的位置
				String hql = "update " + entityName + " set "+indexName+"=? where "+parentName+"=? and "+indexName+"=?";
				createQuery(hql)
					.setParameter(0, dbObject.getIndex())
					.setParameter(1, dbObject.getParent())
					.setParameter(2, currObject.getIndex())
					.executeUpdate();
			}
			
		}
		// 可移动的
		else if (Movable.class.isAssignableFrom(cls)) {
			Movable currObject = (Movable) entity;
			Movable dbObject = (Movable) getCurrentSession().get(cls, entity.getId());
			if( ! dbObject.getIndex().equals(currObject.getIndex()) ){
				String hql = "update " + entityName + " set "+indexName+"=? where "+indexName+"=? ";
				createQuery(hql)
					.setParameter(0, currObject.getIndex())
					.setParameter(1, dbObject.getIndex())
					.executeUpdate();
			}
		}
		
		return entity;
	}
574121
function () {
        const editor = this.editor
        const $textElem = editor.$textElem

        $textElem.on('keydown', e => {
            if (e.keyCode !== 8) {
                return
            }
            const txtHtml = $textElem.html().toLowerCase().trim()
            if (txtHtml === '<p><br></p>') {
                // 最后剩下一个空行，就不再删除了
                e.preventDefault()
                return
            }
        })

        $textElem.on('keyup', e => {
            if (e.keyCode !== 8) {
                return
            }
            let $p
            const txtHtml = $textElem.html().toLowerCase().trim()

            // firefox 时用 txtHtml === '<br>' 判断，其他用 !txtHtml 判断
            if (!txtHtml || txtHtml === '<br>') {
                // 内容空了
                $p = $('<p><br/></p>')
                $textElem.html('') // 一定要先清空，否则在 firefox 下有问题
                $textElem.append($p)
                editor.selection.createRangeByElem($p, false, true)
                editor.selection.restoreSelection()
            }
        })

    }
1131104
public String consumeDigit() {
        int start = pos;

        if (queue.charAt(pos) == '-') {// 负数标记
            pos++;
        }
        while (!isEmpty() && Character.isDigit(queue.charAt(pos))) {
            pos++;
        }

        if (!isEmpty() && queue.charAt(pos) == '.' && remainingLength() >= 2
                && Character.isDigit(queue.charAt(pos + 1))) {// 小数点
            pos++;
            while (!isEmpty() && Character.isDigit(queue.charAt(pos))) {
                pos++;
            }
        }

        return queue.substring(start, pos);
    }
700430
private function gc()
    {
        if (!$this->gc['probability']) {
            return; //不做垃圾回收
        }

        $p = 1 / $this->gc['probability'];
        if (mt_rand(1, $p) != $p) {
            return; //未命中
        }

        $expired = time() - $this->gc['max_life'];
        $sql     = "DELETE FROM `$this->table` WHERE  `$this->time`<$expired and `$this->type`=1";
        $this->Driver->beginTransaction();
        $this->Driver->execute($sql);
        $this->Driver->commit();
    }
919318
private function regular() {
        /** 获取PATHINFO */
        $pathInfo = $this->pathInfo;//$this->getPathInfo();
        foreach ($this->routingTable as $key => $route) {
            if (!preg_match($route['regx'], $pathInfo, $matches)) {
                continue;
            }
            $this->current = $key;
            /** 载入参数 */
            $params = NULL;
            if (!empty($route['params'])) {
                unset($matches[0]);
                $params = array_combine($route['params'], $matches);
                $req = Request::driver();
                $req->get = array_merge($req->get,$params);
                $req->request = array_merge($req->request,$params);
            }
            $this->pathInfo = '/'.$route['action'];
            return true;
        }
        return false;
    }
515957
function () {
            var reg = new RegExp(domUtils.fillChar, 'g'),
                html = this.body.innerHTML.replace(/[\n\r]/g, '');//ie要先去了\n在处理
            html = html.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi, '\n')
                .replace(/<br\/?>/gi, '\n')
                .replace(/<[^>/]+>/g, '')
                .replace(/(\n)?<\/([^>]+)>/g, function (a, b, c) {
                    return dtd.$block[c] ? '\n' : b ? b : '';
                });
            //取出来的空格会有c2a0会变成乱码，处理这种情况\u00a0
            return html.replace(reg, '').replace(/\u00a0/g, ' ').replace(/&nbsp;/g, ' ');
        }
1287160
function _checkStringElem(xml, tmplRule, outputH) {
  var root = [],
      current = {
    elem: root,
    elemName: 'root',
    parent: null
  },
      parent = null,
      pattern = tmplRule.checkElem,
      matchArr,
      inTextContent,
      omittedCloseElem = null;

  while (matchArr = pattern.exec(xml)) {
    var textBefore = matchArr[1],
        elem = matchArr[2],
        elemName = matchArr[3],
        elemParams = matchArr[4],
        textAfter = matchArr[5]; //处理上一次循环中的可省略闭合标签

    if (omittedCloseElem) {
      var _omittedCloseElem = omittedCloseElem,
          _omittedCloseElem2 = _slicedToArray(_omittedCloseElem, 4),
          _elem = _omittedCloseElem2[0],
          _elemName = _omittedCloseElem2[1],
          _elemParams = _omittedCloseElem2[2],
          _textAfter = _omittedCloseElem2[3];

      var isEx = elem ? isExAll(elemName, tmplRule) : false;

      if (isEx && !isEx[1] && (isPropS(elemName, tmplRule) || isStrPropS(elemName, tmplRule) || isParamsEx(isEx[3]) || exCompileConfig(isEx[3]).isDirective)) {
        parent = current;
        current = _createCurrent(_elemName, parent);

        _setElem(_elem, _elemName, _elemParams, current.elem, null, tmplRule, outputH);
      } else {
        _setSelfCloseElem(_elem, _elemName, _elemParams, current.elem, tmplRule, outputH);
      }

      _setTextAfter(_textAfter, current);

      omittedCloseElem = null;
    } //Text before tag


    if (textBefore && textBefore !== '') {
      _setText(textBefore, current.elem);
    } //Element tag


    if (elem) {
      if (elem !== '<') {
        if (elem.indexOf('<!') === 0) {
          //一些特殊标签当做文本处理
          _setText(elem, current.elem);
        } else {
          var _isEx = isExAll(elemName, tmplRule);

          if (elemName[0] === '/') {
            //Close tag
            if (elemName.substr(1).toLowerCase() === inTextContent) {
              //取消纯文本子节点标记
              inTextContent = null;
            }

            if (_isEx || !inTextContent) {
              var cName = current.elemName;

              if (cName.indexOf(SPLIT_FLAG) < 0 ? elemName === '/' + cName : elemName.indexOf(SPLIT_FLAG) > -1 || elemName === '//') {
                //如果开始标签包含SPLIT_FLAG，则只要结束标签包含SPLIT_FLAG就认为该标签已关闭
                current = current.parent;
              }
            } else {
              _setText(elem, current.elem);
            }
          } else if (elem[elem.length - 2] === '/') {
            //Self close tag
            if (_isEx || !inTextContent) {
              _setSelfCloseElem(elem, elemName, elemParams, current.elem, tmplRule, outputH);
            } else {
              _setText(elem, current.elem);
            }
          } else {
            //Open tag
            if (_isEx || !inTextContent) {
              if (!inTextContent && OMITTED_CLOSE_TAGS$1[elemName.toLowerCase()]) {
                //img等可不闭合标签
                omittedCloseElem = [elem, elemName, elemParams, textAfter];
              } else {
                var elemNameL = elemName.toLowerCase();

                if (TEXT_CONTENT.indexOf(elemNameL) > -1) {
                  //标记该标签为纯文本子节点
                  inTextContent = elemNameL;
                }

                parent = current;
                current = _createCurrent(elemName, parent);

                _setElem(elem, elemName, elemParams, current.elem, null, tmplRule, outputH);
              }
            } else {
              _setText(elem, current.elem);
            }
          }
        }
      } else {
        //单独的"<"和后面的文本拼合在一起
        if (textAfter == null) {
          textAfter = '';
        }

        textAfter = elem + textAfter;
      }
    } //Text after tag


    !omittedCloseElem && _setTextAfter(textAfter, current);
  } //处理最后一次循环中遗留的可省略闭合标签


  if (omittedCloseElem) {
    var _omittedCloseElem3 = omittedCloseElem,
        _omittedCloseElem4 = _slicedToArray(_omittedCloseElem3, 4),
        _elem2 = _omittedCloseElem4[0],
        _elemName2 = _omittedCloseElem4[1],
        _elemParams2 = _omittedCloseElem4[2],
        _textAfter2 = _omittedCloseElem4[3];

    _setSelfCloseElem(_elem2, _elemName2, _elemParams2, current.elem, tmplRule, outputH);

    _setTextAfter(_textAfter2, current);
  }

  return root;
}
412415
public void norm_sethour()
	{
		/*
		 * 清除只能识别11-99时的bug
		 * modified by 曹零
		 */
		String rule="(?<!(周|星期))([0-2]?[0-9])(?=(点|时))";
		
		Pattern pattern=Pattern.compile(rule);
		Matcher match=pattern.matcher(Time_Expression);
		if(match.find())
		{
			_tp.tunit[3]=Integer.parseInt(match.group());
		}	
		/*
		 * 对关键字：中午,午间,下午,午后,晚上,傍晚,晚间,晚,pm,PM的正确时间计算
		 * 规约：
		 * 1.中午/午间0-10点视为12-22点
		 * 2.下午/午后0-11点视为12-23点
		 * 3.晚上/傍晚/晚间/晚1-11点视为13-23点，12点视为0点
		 * 4.0-11点pm/PM视为12-23点
		 * 
		 * add by 曹零
		 */
		rule = "(中午)|(午间)";
		pattern = Pattern.compile(rule);
		match = pattern.matcher(Time_Expression);
		if(match.find()){
			if(_tp.tunit[3] >= 0 && _tp.tunit[3] <= 10)
				_tp.tunit[3] += 12;
		}
		
		rule = "(下午)|(午后)|(pm)|(PM)";
		pattern = Pattern.compile(rule);
		match = pattern.matcher(Time_Expression);
		if(match.find()){
			if(_tp.tunit[3] >= 0 && _tp.tunit[3] <= 11)
				_tp.tunit[3] += 12;
		}
		
		rule = "晚";
		pattern = Pattern.compile(rule);
		match = pattern.matcher(Time_Expression);
		if(match.find()){
			if(_tp.tunit[3] >= 1 && _tp.tunit[3] <= 11)
				_tp.tunit[3] += 12;
			else if(_tp.tunit[3] == 12)
				_tp.tunit[3] = 0;
		}
	}
1080984
function (jsonObj) {
    if ($bc_.pN) {
      try {
        var params = jsonObj || {}
        params['silent'] = params['silent'] || false
        params['printBackground'] = params['printBackground'] || false

        // 统一向后兼容处理
        for (var key in jsonObj) {
          if (jsonObj.hasOwnProperty(key)) {
            params[key] = jsonObj[key]
          }
        }

        return $bc_.pN.window.print(JSON.stringify(params))
      } catch (e) {
        console.error(e)
      }
    }
  }