Difference of * and + in regular expression

Hi, If I used the uncommented if-statement, I would get no match. If I used the commend if statement otherwise, I would have the following string as the output. I'm wondering why the regular expression with * does not match anything? namespace a { namespace b { namespace c { Thanks, Peng $string="a namespace a { namespace b { namespace c { ";