示例#1
0
 public int getNameToBackrefNumber(String name) {
   try {
     byte[] bytes = name.getBytes();
     return pattern.nameToBackrefNumber(bytes, 0, bytes.length, regs);
   } catch (JOniException je) {
     throw getRuntime().newIndexError(je.getMessage());
   }
 }
示例#2
0
 private int nameToBackrefNumber(RubyString str) {
   ByteList value = str.getByteList();
   try {
     return pattern.nameToBackrefNumber(
         value.getUnsafeBytes(), value.getBegin(), value.getBegin() + value.getRealSize(), regs);
   } catch (JOniException je) {
     throw getRuntime().newIndexError(je.getMessage());
   }
 }