According to the tutorial I'm following:
{n} matches exactly n of the previous thing
Thus I expect:
"fo" =~ /o{2}/ = false
"foo" =~ /o{2}/ = true
"fooo" =~ /o{2}/ = false
Instead I get:
"fo" =~ /o{2}/ = false
"foo" =~ /o{2}/ = true
"fooo" =~ /o{2}/ = true
I have similar issues with {x,y}. I expect:
"fa" =~ /a{2,4}/ = false
"faa" =~ /a{2,4}/ = true
"faaa" =~ /a{2,4}/ = true
"faaaa" =~ /a{2,4}/ = true
"faaaaa" =~ /a{2,4}/ = false
Instead I get:
"fa" =~ /a{2,4}/ = false
"faa" =~ /a{2,4}/ = true
"faaa" =~ /a{2,4}/ = true
"faaaa" =~ /a{2,4}/ = true
"faaaaa" =~ /a{2,4}/ = true
What am I doing wrong, or misunderstanding?
Daniel Kurtz