I'm confused about why does asterisk have an impact on the regular expressions results in Ruby? Example codes are below:
2.3.0 :001 > "abbcccddddeeeee"[/z*/]
=> ""
2.3.0 :002 > "abbcccddddeeeee"[/z/]
=> nil
Why the first one with *
returns an empty string, while the other one returns nil
?
Thanks!