From fbeeb89b3d442d3be27544b058cc9d5b5dc4accc Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Fri, 12 Sep 2025 08:14:24 -0500 Subject: [DOC] Tweaks for String#match? (#14477) --- string.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index dd275ba075..ca5d837252 100644 --- a/string.c +++ b/string.c @@ -5119,24 +5119,23 @@ rb_str_match_m(int argc, VALUE *argv, VALUE str) * call-seq: * match?(pattern, offset = 0) -> true or false * - * Returns +true+ or +false+ based on whether a match is found for +self+ and +pattern+. + * Returns whether a match is found for +self+ and the given arguments; + * does not update {Regexp Global Variables}[rdoc-ref:Regexp@Global+Variables]. * - * Note: does not update Regexp@Global+Variables. + * Computes +regexp+ by converting +pattern+ (if not already a Regexp): * - * Computes +regexp+ by converting +pattern+ (if not already a Regexp). * regexp = Regexp.new(pattern) * - * Returns +true+ if self+.match(regexp) returns a MatchData object, + * Returns +true+ if self[offset..].match(regexp) returns a MatchData object, * +false+ otherwise: * * 'foo'.match?(/o/) # => true * 'foo'.match?('o') # => true * 'foo'.match?(/x/) # => false - * - * If Integer argument +offset+ is given, the search begins at index +offset+: * 'foo'.match?('f', 1) # => false * 'foo'.match?('o', 1) # => true * + * Related: see {Querying}[rdoc-ref:String@Querying]. */ static VALUE -- cgit v1.2.3