[ruby/strscan] [DOC] doc/strscan/strscan.md - update Matcher Methods

(https://github.com/ruby/strscan/pull/123)

Added support for string pattern type in
https://github.com/ruby/strscan/pull/106.
And fix Success Return content.

https://github.com/ruby/strscan/commit/6a5acde674
This commit is contained in:
NAITOH Jun 2024-12-08 08:01:34 +09:00 committed by Hiroshi SHIBATA
parent b5ed7aae3b
commit cb8f186205
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -327,13 +327,13 @@ and attempts to find a matching substring in the [target substring][3].
| Method | Pattern Type | Matches Target Substring | Success Return | May Update Positions? |
|--------------|-------------------|--------------------------|--------------------|-----------------------|
| #check | Regexp or String. | At beginning. | Matched substring. | No. |
| #check_until | Regexp. | Anywhere. | Substring. | No. |
| #match? | Regexp or String. | At beginning. | Updated position. | No. |
| #exist? | Regexp. | Anywhere. | Updated position. | No. |
| #check_until | Regexp or String. | Anywhere. | Substring. | No. |
| #match? | Regexp or String. | At beginning. | Match size. | No. |
| #exist? | Regexp or String. | Anywhere. | Substring size. | No. |
| #scan | Regexp or String. | At beginning. | Matched substring. | Yes. |
| #scan_until | Regexp. | Anywhere. | Substring. | Yes. |
| #scan_until | Regexp or String. | Anywhere. | Substring. | Yes. |
| #skip | Regexp or String. | At beginning. | Match size. | Yes. |
| #skip_until | Regexp. | Anywhere. | Position delta. | Yes. |
| #skip_until | Regexp or String. | Anywhere. | Substring size. | Yes. |
<br>
@ -351,14 +351,14 @@ Which matcher you choose will depend on:
- Traverse, by advancing the positions:
#scan, #scan_until, #skip, #skip_until.
- Keep the positions unchanged:
#check, #check_until, #exist?, #match?.
#check, #check_until, #match?, #exist?.
- What you want for the return value:
- The matched substring: #check, #check_until, #scan, #scan_until.
- The updated position: #exist?, #match?.
- The position delta: #skip_until.
- The match size: #skip.
- The matched substring: #check, #scan.
- The substring: #check_until, #scan_until.
- The match size: #match?, #skip.
- The substring size: #exist?, #skip_until.
### Match Values