From: Yehuda Katz Date: 2009-08-03T09:04:21+09:00 Subject: [ruby-core:24699] Re: Proposal: match? with no backrefs This is a multi-part message in MIME format. --------------080008090603010702030808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In both of those cases, $1 is set. I'm looking for a way to check if a regular expression match occurred without the additional overhead of creating the match elements and storing them in the backref "locals". -- Yehuda NARUSE, Yui wrote: > Yehuda Katz wrote: > >> "string".match? (/regex/) >> str.match?(regex) >> > > Regexp#=~ or Regexp#=== can't satisfy you? > > --------------080008090603010702030808 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit In both of those cases, $1 is set. I'm looking for a way to check if a regular expression match occurred without the additional overhead of creating the match elements and storing them in the backref "locals".

-- Yehuda

NARUSE, Yui wrote:
Yehuda Katz wrote:
  
"string".match? (/regex/)
str.match?(regex)
    

Regexp#=~ or Regexp#=== can't satisfy you?

  
--------------080008090603010702030808--