On 2016-11-18 15:01, Robert Klemme wrote:
> On Fri, Nov 18, 2016 at 1:20 PM, Die Optimisten
> <inform / die-optimisten.net> wrote:
>> On 2016-11-17 10:39, timlen tse wrote:
>>> I think you want `String#[] `  for example:
>>>   "sample"[/\d+/]
>>>   # => nil
>> Thank you!
> This will not return the whole string though unless the regex matches
> the whole string.
>
> Can you be more specific about your intended use case?
>
> Kind regards
>
> robert
>
Yes -  so the whole string has to match the regex (vice versa :))
Opti


Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>