取得内容中匹配的所有结果，获得匹配的所有结果中正则对应分组0的内容

@param regex 正则
@param content 被查找的内容
@return 结果列表
@since 3.1.2
356833
public static List<String> findAllGroup0(String regex, CharSequence content) {
		return findAll(regex, content, 0);
	}
644818
function strategyForRegEx(regex) {
      // Ensure the 'global' flag is set.
      if (regex instanceof RegExp) {
        regex = regex.source;
      }
      regex = new RegExp(regex, "g");

      return function(contentBlock, callback) {
        var text = contentBlock.getText();
        var matchArr = null;
        while ((matchArr = regex.exec(text)) !== null) {
          var start = matchArr.index;
          callback(start, start + matchArr[0].length);
        }
      };
    }
366953
public static String unescape(String content) {
		if (StrUtil.isBlank(content)) {
			return content;
		}

		StringBuilder tmp = new StringBuilder(content.length());
		int lastPos = 0, pos = 0;
		char ch;
		while (lastPos < content.length()) {
			pos = content.indexOf("%", lastPos);
			if (pos == lastPos) {
				if (content.charAt(pos + 1) == 'u') {
					ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
					tmp.append(ch);
					lastPos = pos + 6;
				} else {
					ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
					tmp.append(ch);
					lastPos = pos + 3;
				}
			} else {
				if (pos == -1) {
					tmp.append(content.substring(lastPos));
					lastPos = content.length();
				} else {
					tmp.append(content.substring(lastPos, pos));
					lastPos = pos;
				}
			}
		}
		return tmp.toString();
	}
627686
function(regex){
		//if it isn't global, `exec()` will not start at `lastIndex`
		if(!regex.global)
			regex.compile(regex.source, flags(regex));
		regex.lastIndex = this.position;
		var m = regex.exec(this.source);

		//all matches must start at the current position.
		if(m && m.index!=this.position){
			return null;
		}

		if(m) this.position += m[0].length;
		return m;
	}
234839
public static String extractRegexGroup(String fromContent, String regex, int groupNumber) throws Exception {
        if (regex == null) {
            throw new Exception("Cannot extract regex group because the provided regular expression is null.");
        }
        Pattern expectedPattern = Pattern.compile(regex);
        return extractRegexGroup(fromContent, expectedPattern, groupNumber);
    }
829470
function(content) {
			content = this.sanitize(content);
			var stream = stringStream(content);
			var ranges = [], matchedRanges;
			var self = this;

			var saveRule = function(r) {
				var selRange = self.extractSelector(content, r.start);
				var rule = range.create2(selRange.start, r.end);
				rule._selectorEnd = selRange.end;
				rule._contentStart = r.start;
				ranges.push(rule);
			};

			var ch;
			while (ch = stream.next()) {
				if (isQuote(ch)) {
					if (!stream.skipString(ch)) {
						break; // unterminated string
					}

					continue;
				}

				if (ch == '{') {
					matchedRanges = this.matchBracesRanges(content, stream.pos - 1);
					matchedRanges.forEach(saveRule);

					if (matchedRanges.length) {
						stream.pos = utils.last(matchedRanges).end;
						continue;
					} 
				}
			}
			
			return ranges.sort(function(a, b) {
				return a.start - b.start;
			});
		}
492843
public static String toJava(String regex) {
        if (StringUtils.isBlank(regex)) {
            return regex;
        } else {
            return regex.replaceAll("\\.", "\\\\.")
                    .replaceAll("\\*",".*");
        }
    }
470261
public List<String> getCellValues(String regex, List<ReplacePattern> replaces,
            boolean excludeEmptyValue) {
        List<String> valueList = new ArrayList<String>();

        if (StringUtils.isEmpty(regex)) {
            LOG.warn("列名が空であるセル値は格納できません。");
            return valueList;
        }
        Pattern pattern = Pattern.compile(regex);
        for (Entry<String, String> entry : getData().entrySet()) {
            if (pattern.matcher(entry.getKey()).matches()) {
                if (excludeEmptyValue && StringUtils.isEmpty(entry.getValue())) {
                    continue;
                }
                String value = value(entry.getValue(), replaces);
                LOG.trace("key:{}, value:{}", entry.getKey(), value);
                valueList.add(value);
            }
        }

        return valueList;
    }
675381
public static String extractRegexGroup(String fromContent, Pattern regex, int groupNumber) throws Exception {
        if (fromContent == null) {
            throw new Exception("Cannot extract regex group because the provided content string is null.");
        }
        if (regex == null) {
            throw new Exception("Cannot extract regex group because the provided regular expression is null.");
        }
        if (groupNumber < 0) {
            throw new Exception("Group number to extract must be non-negative. Provided group number was " + groupNumber);
        }
        Matcher matcher = regex.matcher(fromContent);
        if (!matcher.find()) {
            throw new Exception("Did not find any matches for regex [" + regex + "] in the provided content: [" + fromContent + "].");
        }
        if (matcher.groupCount() < groupNumber) {
            throw new Exception("Found " + matcher.groupCount() + " matching groups in the content, but expected at least " + groupNumber + ". Regex was [" + regex + "] and content was [" + fromContent + "].");
        }
        return matcher.group(groupNumber);
    }
1070958
private Map<String, Double> getTF(String content) {
		Map<String,Double> tfMap=new HashMap<>();
		if(content==null || content.equals(""))
			return tfMap; 
		
		JiebaSegmenter segmenter = new JiebaSegmenter();
		List<String> segments=segmenter.sentenceProcess(content);
		Map<String,Integer> freqMap=new HashMap<>();
		
		int wordSum=0;
		for(String segment:segments) {
			//停用词不予考虑，单字词不予考虑
			if(!stopWordsSet.contains(segment) && segment.length()>1) {
				wordSum++;
				if(freqMap.containsKey(segment)) {
					freqMap.put(segment,freqMap.get(segment)+1);
				}else {
					freqMap.put(segment, 1);
				}
			}
		}
		
		// 计算double型的tf值
		for(String word:freqMap.keySet()) {
			tfMap.put(word,freqMap.get(word)*0.1/wordSum);
		}
		
		return tfMap; 
	}
1291290
public static String delAll(Pattern pattern, CharSequence content) {
		if (null == pattern || StrUtil.isBlank(content)) {
			return StrUtil.str(content);
		}

		return pattern.matcher(content).replaceAll(StrUtil.EMPTY);
	}
773479
def regexpExec(self, content):
        
        ret = libxml2mod.xmlRegexpExec(self._o, content)
        return ret
787884
public static boolean contains(Pattern pattern, CharSequence content) {
		if (null == pattern || null == content) {
			return false;
		}
		return pattern.matcher(content).find();
	}
104530
public static String delPre(String regex, CharSequence content) {
		if (null == content || null == regex) {
			return StrUtil.str(content);
		}

		// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
		final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
		Matcher matcher = pattern.matcher(content);
		if (matcher.find()) {
			return StrUtil.sub(content, matcher.end(), content.length());
		}
		return StrUtil.str(content);
	}
624868
public static String htmlEncode(String content) {
		if (null == content) {
			return "";
		}
		return content.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
	}
153582
protected function _filterAll($regex, $content, $i = 1, $key = '') {
		if (@preg_match_all($regex, $content, $matches) === false) {
			return false;
		}
		$result = isset($matches[$i]) ? $matches[$i] : $matches[0];
		if (isset($this->_callback['_all_'])) {
			foreach ($this->_callback['_all_'] as $filter) {
				$result = array_map($filter, $result);
			}
		}
		if ($key != '' && isset($this->_callback[$key])) {
			foreach ($this->_callback[$key] as $filter) {
				$result = array_map($filter, $result);
			}
		}
		return $result;
	}
1279243
public static String get(String regex, CharSequence content, int groupIndex) {
		if (null == content || null == regex) {
			return null;
		}

		// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
		final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
		return get(pattern, content, groupIndex);
	}