Robert Klemme
10/9/2003 10:13:00 AM
"Simon Strandgaard" <none> schrieb im Newsbeitrag
news:3f853379$0$69912$edfadb0f@dread12.news.tele.dk...
> irb(main):001:0> re = /bx{,2}c/
> => /bx{,2}c/
> irb(main):002:0> re.match("abxcd")
> => nil
> irb(main):003:0> re = /bx{0,2}c/
> => /bx{0,2}c/
> irb(main):004:0> re.match("abxcd")
> => #<MatchData:0x81c46d0>
> irb(main):005:0>
>
>
> Is {,2} notation supported ?
> If not.. shouldn't it raise an exception ?
Interestingly enough negative values do not cause errors but do not match
either:
irb(main):008:0> /f{-1,2}/ =~ "aaffff"
=> nil
IMHO this should either raise an error or match, since there are more
than -1 "f"'s in the string.
Regards
robert