Is it possible to define [a-zA-Z0-9_\-~.]+ in just one place?