Avoid repeated regex parsing for constant values