reduce 20% of time cost by optimizing getlink's regexp
another 20% cost reduction by removing a regex