March 9, 2010

Regular expressions

Hi,

Can anyone please tell me how many below lines will match for the pattern /a*bc[e-g]*[0-9]*/.

1.aaaaabcfgh19919234
2.bc
3.abcefg123456789
4.abc45
5.aabcggg87310

If it is matching all the lines then could you please explain me how it is matching lines 2 and 4.

Thanks in advance.

Regards
Ravi.K