本文整理了Java中org.joni.Regex.matcherNoRegion
方法的一些代码示例,展示了Regex.matcherNoRegion
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Regex.matcherNoRegion
方法的具体详情如下:
包路径:org.joni.Regex
类名称:Regex
方法名:matcherNoRegion
暂无
代码示例来源:origin: org.jruby.joni/joni
public Matcher matcherNoRegion(byte[]bytes) {
return matcherNoRegion(bytes, 0, bytes.length);
}
代码示例来源:origin: jruby/joni
public Matcher matcherNoRegion(byte[]bytes) {
return matcherNoRegion(bytes, 0, bytes.length);
}
代码示例来源:origin: org.jruby/jruby-complete
private RubyBoolean matchP(ThreadContext context, IRubyObject arg, int pos) {
if (arg == context.nil) return context.fals;
RubyString str = arg instanceof RubySymbol ? ((RubySymbol) arg).to_s(context.runtime) : arg.convertToString();
if (pos != 0) {
if (pos < 0) {
pos += str.strLength();
if (pos < 0) return context.fals;
}
pos = str.rbStrOffset(pos);
}
final Regex reg = preparePattern(str);
final ByteList strBL = str.getByteList();
final int beg = strBL.begin();
Matcher matcher = reg.matcherNoRegion(strBL.unsafeBytes(), beg, beg + strBL.realSize());
try {
final int result = matcherSearch(context, matcher, beg + pos, beg + strBL.realSize(), RE_OPTION_NONE);
return result == -1 ? context.fals : context.tru;
} catch (JOniException je) {
throw context.runtime.newRegexpError(je.getMessage());
}
}
代码示例来源:origin: org.jruby/jruby-core
private RubyBoolean matchP(ThreadContext context, IRubyObject arg, int pos) {
if (arg == context.nil) return context.fals;
RubyString str = arg instanceof RubySymbol ? ((RubySymbol) arg).to_s(context.runtime) : arg.convertToString();
if (pos != 0) {
if (pos < 0) {
pos += str.strLength();
if (pos < 0) return context.fals;
}
pos = str.rbStrOffset(pos);
}
final Regex reg = preparePattern(str);
final ByteList strBL = str.getByteList();
final int beg = strBL.begin();
Matcher matcher = reg.matcherNoRegion(strBL.unsafeBytes(), beg, beg + strBL.realSize());
try {
final int result = matcherSearch(context, matcher, beg + pos, beg + strBL.realSize(), RE_OPTION_NONE);
return result == -1 ? context.fals : context.tru;
} catch (JOniException je) {
throw context.runtime.newRegexpError(je.getMessage());
}
}
内容来源于网络,如有侵权,请联系作者删除!