Forum: Ruby why does this regular expression match?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dominique P. (Guest)
on 2006-03-10 06:38
(Received via mailing list)
Using Test::Unit:

r1 = /a*/
assert_nil,'A' =~ r1

The error I get implies that it would match in the same way that the
following would match
'a' =~ r1

Can anyone offer any suggestions?


ps. done a google search on Test::Unit lately?
1337p337 (Guest)
on 2006-03-10 06:51
(Received via mailing list)
The asterisk means "Zero or more of these".  You may want to use /a+/
(One or more 'a's).
This topic is locked and can not be replied to.