port regexp matcher from narwhal