Regex: support the dot

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2013-11-14 11:13:12 -06:00
parent e2105670a0
commit d753edafcd
2 changed files with 5 additions and 0 deletions

View File

@ -33,5 +33,7 @@ public class Regex {
expectNoMatch("a(bb)?a", "abbba");
expectNoMatch("a(bb)?a", "abbaa");
expectGroups("a(a*?)(a?)(a??)(a+)(a*)a", "aaaaaa", "", "a", "", "aaa", "");
expectMatch("...", "abc");
expectNoMatch(".", "\n");
}
}

View File

@ -141,6 +141,9 @@ class Compiler implements PikeVMOpcodes {
continue;
}
switch (c) {
case '.':
current.push(DOT);
continue;
case '?':
current.push(new QuestionMark(current.pop()));
break;