28 Mar
2011
28 Mar
'11
8:25 a.m.
My pattern matching was failing when I had these definitions, which I happen to prefer:
const string number = "[0-9]+"; const string name = "[A-z][A-z0-9]*";
("name" is supposed to match a typical variable name)
The program is working fine now, after I am using these ones:
const string number = "\\d+"; const string name = "[A-z]\\w*";
The only difference that I aware of, is that the second form accepts underscores as part of variable names.
Correct there should be no difference - do you have a test case? Thanks, John.