use perl instead of grep -P