summaryrefslogtreecommitdiff
path: root/doc/strscan/methods/skip_until.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/strscan/methods/skip_until.md')
-rw-r--r--doc/strscan/methods/skip_until.md13
1 files changed, 6 insertions, 7 deletions
diff --git a/doc/strscan/methods/skip_until.md b/doc/strscan/methods/skip_until.md
index 5187a4826f..a0ffab0b84 100644
--- a/doc/strscan/methods/skip_until.md
+++ b/doc/strscan/methods/skip_until.md
@@ -1,16 +1,14 @@
-call-seq:
- skip_until(pattern) -> matched_substring_size or nil
-
Attempts to [match][17] the given `pattern`
-anywhere (at any [position][2]) in the [target substring][3];
-does not modify the positions.
+anywhere (at any [position][2]) in the [target substring][3].
If the match attempt succeeds:
- Sets [match values][9].
+- Sets the [byte position][2] to the end of the matched substring;
+ may adjust the [character position][7].
- Returns the size of the matched substring.
-```
+```rb
scanner = StringScanner.new(HIRAGANA_TEXT)
scanner.string # => "こんにちは"
scanner.pos = 6
@@ -42,8 +40,9 @@ If the match attempt fails:
- Clears match values.
- Returns `nil`.
+- Does not update positions.
-```
+```rb
scanner.skip_until(/nope/) # => nil
match_values_cleared?(scanner) # => true
```