Use regular expressions instead of os.Expand.