grammar += 'rule = "abc"\n';
exp = new ApgExp(grammar, flags);
console.log();
console.log('Demonstrate the test function.');
console.log();
console.log(`grammar: ${exp.source}`);
str = 'abc';
result = exp.test(str);
console.log(` flags: '${exp.flags}'`);
console.log(` input: ${str}`);
console.log(` test: ${result}`);
str = '---abc---';
result = exp.test(str);
console.log();
console.log(` flags: '${exp.flags}'`);
console.log(` input: ${str}`);
console.log(` test: ${result}`);
str = '---a-bc---';
result = exp.test(str);
console.log();
console.log(` flags: '${exp.flags}'`);
console.log(` input: ${str}`);
console.log(` test: ${result}`);