perf-opt: use startsWith instead of RegExp