public static RubyArray /*!*/ Offset(MatchData /*!*/ self, [DefaultProtocol] int groupIndex) { self.RequireExistingGroup(groupIndex); RubyArray result = new RubyArray(2); if (self.GroupSuccess(groupIndex)) { result.Add(self.GetGroupStart(groupIndex)); result.Add(self.GetGroupEnd(groupIndex)); } else { result.Add(null); result.Add(null); } return(result); }
private static void AppendLastCharOfLastMatchGroup(MatchData/*!*/ match, MutableString/*!*/ result) { int i = match.GroupCount - 1; // move to last successful match group while (i > 0 && !match.GroupSuccess(i)) { i--; } if (i > 0 && match.GroupSuccess(i)) { int length = match.GetGroupLength(i); if (length > 0) { result.Append(match.OriginalString, match.GetGroupStart(i) + length - 1, 1); } } }
public static RubyArray/*!*/ Offset(MatchData/*!*/ self, [DefaultProtocol]int groupIndex) { self.RequireExistingGroup(groupIndex); RubyArray result = new RubyArray(2); if (self.GroupSuccess(groupIndex)) { result.Add(self.GetGroupStart(groupIndex)); result.Add(self.GetGroupEnd(groupIndex)); } else { result.Add(null); result.Add(null); } return result; }
public static object End(MatchData/*!*/ self, [DefaultProtocol]int groupIndex) { self.RequireExistingGroup(groupIndex); return self.GroupSuccess(groupIndex) ? ScriptingRuntimeHelpers.Int32ToObject(self.GetGroupEnd(groupIndex)) : null; }
public static object End(MatchData /*!*/ self, [DefaultProtocol] int groupIndex) { self.RequireExistingGroup(groupIndex); return(self.GroupSuccess(groupIndex) ? ScriptingRuntimeHelpers.Int32ToObject(self.GetGroupEnd(groupIndex)) : null); }