summaryrefslogtreecommitdiff
path: root/doc/strscan/methods/scan_until.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/strscan/methods/scan_until.md')
-rw-r--r--doc/strscan/methods/scan_until.md7
1 files changed, 2 insertions, 5 deletions
diff --git a/doc/strscan/methods/scan_until.md b/doc/strscan/methods/scan_until.md
index 3b7ff2c3a9..5fb2912a1b 100644
--- a/doc/strscan/methods/scan_until.md
+++ b/doc/strscan/methods/scan_until.md
@@ -1,6 +1,3 @@
-call-seq:
- scan_until(pattern) -> substring or nil
-
Attempts to [match][17] the given `pattern`
anywhere (at any [position][2]) in the [target substring][3].
@@ -12,7 +9,7 @@ If the match attempt succeeds:
- Returns the matched substring.
-```
+```rb
scanner = StringScanner.new(HIRAGANA_TEXT)
scanner.string # => "こんにちは"
scanner.pos = 6
@@ -46,7 +43,7 @@ If the match attempt fails:
- Returns `nil`.
- Does not update positions.
-```
+```rb
scanner.scan_until(/nope/) # => nil
match_values_cleared?(scanner) # => true
```