Actions
Bug #1572
closedRegex range: upper range limit apparently not applied on digit matching
Bug #1572:
Regex range: upper range limit apparently not applied on digit matching
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.0 (2008-06-20 revision 17482) [i486-linux]
Backport:
Description
=begin
I have this regex /fs[# ]{0,2}[\d]{3,6}/
Out of array = ["FS#", "FS#10048", "within a fs#10048 sentence", "fs# 9919", "fs100", "fs wow", "fs 1", "fs#132929921 "] it matches the array[1], array[2], array[3], array[4] and array[-1].
It shouldn't match the last element, as I maxed the repitions of \d to 6.
=end
Files
Updated by shyouhei (Shyouhei Urabe) over 16 years ago
- Status changed from Open to Rejected
=begin
Take a try to match /foo/ over "foo921 ".
It's a nature of a regex.
=end
Updated by nobu (Nobuyoshi Nakada) over 16 years ago
=begin
Hi,
At Sat, 6 Jun 2009 00:58:23 +0900,
Thomas Martitz wrote in [ruby-core:23716]:
I have this regex /fs[# ]{0,2}[\d]{3,6}/
Use /fs[# ]{0,2}\d{3,6}(?!\d)/i or /fs[# ]{0,2}\d{3,6}\b/i.
--
Nobu Nakada
=end
Actions