We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
+
MatchData#integer_at
1 parent 2ad7886 commit 801a4e4Copy full SHA for 801a4e4
1 file changed
test/ruby/test_regexp.rb
@@ -1694,7 +1694,7 @@ def test_matchdata_large_capture_groups_stack
1694
end
1695
1696
def test_match_integer_at
1697
- m = /(\d+{4})(\d+{2})(\d+{2})/.match("20260308")
+ m = /(\d{4})(\d{2})(\d{2})/.match("20260308")
1698
assert_equal(20260308, m.integer_at(0))
1699
assert_equal(2026, m.integer_at(1))
1700
assert_equal(3, m.integer_at(2))
@@ -1711,7 +1711,7 @@ def test_match_integer_at
1711
1712
1713
def test_match_integer_at_name
1714
- m = /(?<y>\d+{4})(?<m>\d+{2})(?<d>\d+{2})/.match("20260308")
+ m = /(?<y>\d{4})(?<m>\d{2})(?<d>\d{2})/.match("20260308")
1715
assert_equal(2026, m.integer_at("y"))
1716
assert_equal(3, m.integer_at("m"))
1717
assert_equal(8, m.integer_at("d"))
0 commit comments