本文整理汇总了C#中IronRuby.StandardLibrary.StringScanner.StringScanner.Match方法的典型用法代码示例。如果您正苦于以下问题:C# StringScanner.Match方法的具体用法?C# StringScanner.Match怎么用?C# StringScanner.Match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronRuby.StandardLibrary.StringScanner.StringScanner
的用法示例。
在下文中一共展示了StringScanner.Match方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SearchFull
public static object SearchFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advancePointer, bool returnString)
{
bool match = self.Match(pattern, false, advancePointer);
if (match) {
int length = self.LastMatch.Length + (self.FoundPosition - self.PreviousPosition);
if (returnString) {
return self.ScanString.GetSlice(self.PreviousPosition, length);
} else {
return ScriptingRuntimeHelpers.Int32ToObject(length);
}
}
return null;
}
示例2: SkipUntil
public static int? SkipUntil(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern)
{
bool match = self.Match(pattern, false, true);
if (!match) {
return null;
}
return (self.CurrentPosition - self.PreviousPosition);
}
示例3: ScanFull
public static object ScanFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advancePointer, bool returnString)
{
bool match = self.Match(pattern, true, advancePointer);
if (match) {
if (returnString) {
return MutableString.Create(self.LastMatch);
} else {
return ScriptingRuntimeHelpers.Int32ToObject(self.LastMatch.Length);
}
}
return null;
}
示例4: Match
public static int? Match(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern)
{
if (!self.Match(pattern, true, false)) {
return null;
}
return self.LastMatch.GetLength();
}
示例5: Exist
public static int? Exist(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern)
{
if (!self.Match(pattern, false, false)) {
return null;
}
return self.FoundPosition + self.LastMatch.Length;
}
示例6: SearchFull
public static object SearchFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advance_pointer_p, bool return_string_p) {
bool match = self.Match(pattern, false, advance_pointer_p);
object result = null;
if (match) {
int length = self.LastMatch.Length + (self.FoundPosition - self.PreviousPosition);
if (return_string_p) {
result = self.ScanString.GetSlice(self.PreviousPosition, length);
} else {
result = length;
}
}
return result;
}
示例7: ScanFull
public static object ScanFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advance_pointer_p, bool return_string_p) {
bool match = self.Match(pattern, true, advance_pointer_p);
object result = null;
if (match) {
if (return_string_p) {
result = MutableString.Create(self.LastMatch);
} else {
result = self.LastMatch.Length;
}
}
return result;
}