On Fri, Nov 18, 2016 at 3:18 PM, Die Optimisten
<inform / die-optimisten.net> wrote:
> 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?

> Yes -  so the whole string has to match the regex (vice versa :))

That is not a reply to my question though. I wondered why you asked
your question in the first place (see at thread start). What do you
need that for?

Regards

robert

-- 
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
- without end}
http://blog.rubybestpractices.com/

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