skip_until(p1)
public
Advances the scan pointer until pattern is matched and consumed. Returns the
number of bytes advanced, or nil if no match was found.
Look ahead to match pattern, and advance the scan pointer to the end of the
match. Return the number of characters advanced, or nil if the
match was unsuccessful.
It’s similar to #scan_until, but without returning the intervening string.
s = StringScanner.new("Fri Dec 12 1975 14:39")
s.skip_until /12/
s
Show source
/*
* call-seq: skip_until(pattern)
*
* Advances the scan pointer until +pattern+ is matched and consumed. Returns
* the number of bytes advanced, or +nil+ if no match was found.
*
* Look ahead to match +pattern+, and advance the scan pointer to the _end_
* of the match. Return the number of characters advanced, or +nil+ if the
* match was unsuccessful.
*
* It's similar to #scan_until, but without returning the intervening string.
*
* s = StringScanner.new("Fri Dec 12 1975 14:39")
* s.skip_until /12/
* s
*/
static VALUE
strscan_skip_until(VALUE self, VALUE re)
{
return strscan_do_scan(self, re, 1, 0, 0);
}