本文整理了Java中org.apache.regexp.RE.setMatchFlags
方法的一些代码示例,展示了RE.setMatchFlags
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RE.setMatchFlags
方法的具体详情如下:
包路径:org.apache.regexp.RE
类名称:RE
方法名:setMatchFlags
[英]Sets match behaviour flags which alter the way RE does matching.
[中]设置匹配行为标志,以改变重新进行匹配的方式。
代码示例来源:origin: com.github.jkutner/saferegex
/**
* Construct a matcher for a pre-compiled regular expression from program
* (bytecode) data. Permits special flags to be passed in to modify matching
* behaviour.
*
* @param program Compiled regular expression program (see RECompiler and/or recompile)
* @param matchFlags One or more of the RE match behaviour flags (RE.MATCH_*):
*
* <pre>
* MATCH_NORMAL // Normal (case-sensitive) matching
* MATCH_CASEINDEPENDENT // Case folded comparisons
* MATCH_MULTILINE // Newline matches as BOL/EOL
* </pre>
*
* @see RECompiler
* @see REProgram
* @see recompile
*/
public RE(REProgram program, int matchFlags)
{
setProgram(program);
setMatchFlags(matchFlags);
}
代码示例来源:origin: org.apache.ant/ant-apache-regexp
/**
* Compile the pattern.
*
* @param options the ant regexp options
* @return a compiled pattern
* @exception BuildException if an error occurs
*/
protected RE getCompiledPattern(int options)
throws BuildException {
int cOptions = getCompilerOptions(options);
try {
RE reg = new RE(pattern);
reg.setMatchFlags(cOptions);
return reg;
} catch (RESyntaxException e) {
throw new BuildException(e);
}
}
代码示例来源:origin: org.opennms/opennms-xmp
valueRegex = new RE(valueOperand);
if (!caseSensitive) {
valueRegex.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
代码示例来源:origin: anb0s/LogViewer
public JakartaRegExpRule(LogToolRuleDesc ruleDesc) {
regexp = REUtil.createRE(ruleDesc.getRuleValue());
int flags = regexp.getMatchFlags();
if (ruleDesc.isCaseInsensitive())
flags = org.apache.regexp.RE.MATCH_CASEINDEPENDENT;
regexp.setMatchFlags(flags);
priority = ruleDesc.getPriority();
successToken = new Token(new TokenData(TextAttributeFactory.getTextAttribute(ruleDesc),priority));
}
内容来源于网络,如有侵权,请联系作者删除!