body common control
{
    any::
        bundlesequence  => { test };
}

bundle agent test {

  vars:

   "dirs"
     slist => { "/tmp/.", "/."};


  classes:

    MY_MISTAKE::
      "match$(dirs)" expression => regline("^/\..*","$(dirs)");
    any::
      "match$(dirs)" expression => regcmp("^/\..*","$(dirs)");


  reports:

    linux::
      "$(dirs) match"
        ifvarclass => canonify("match$(dirs)");
}
cf-agent -IK -f ./test.cf
R: /. match

cf-agent -IK -f ./test.cf  -DMY_MISTAKE
..... infinite loop ....

with strace -s 1500 -f cf-agent -IK -f ./test.cf

you will see :

[pid 12047] read(7, 0xb76a8000, 4096)   = -1 EISDIR (Is a directory)

RTFM : builtin function