[#83773] [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769 — usa@...
Issue #14108 has been updated by usa (Usaku NAKAMURA).
9 messages
2017/11/15
[#83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
usa@garbagecollect.jp wrote:
[#83775] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric
[#83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#83781] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric,
[#83782] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[ruby-core:83889] [Ruby trunk Feature#3388] regexp support for start_with? and end_with?
From:
mame@...
Date:
2017-11-27 10:48:07 UTC
List:
ruby-core #83889
Issue #3388 has been updated by mame (Yusuke Endoh).
After that, `String#start_with?` now accepts regexp (#13712). But `end_with?` does not support regexp yet because we don't have a direct use case for `end_with?` (and because of the difficulty of implementation).
----------------------------------------
Feature #3388: regexp support for start_with? and end_with?
https://bugs.ruby-lang.org/issues/3388#change-67928
* Author: trans (Thomas Sawyer)
* Status: Feedback
* Priority: Normal
* Assignee: naruse (Yui NARUSE)
* Target version: next minor
----------------------------------------
=begin
ruby-1.9.2-head > "aBcdeFghIj".start_with?(/abc/i)
=> false
In my implementation of start_with? it is easy enough to utilize #index, which works fine:
def start_with?(pattern)
index(pattern) == 0
end
But #end_with? is more difficult, and I had to use regular expressions.
def end_with?(suffix)
suffix = Regexp.escape(suffix) if String===suffix
/#{suffix}$/.match(self) ? true : false
end
However, we might get rid of the '? true : false' and return the MatchData, since that could be useful information.
=end
---Files--------------------------------
0001-string.c-rb_str_start_with-rb_str_end_with-allow-Reg.patch (4.08 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>