use # for regex delimiter, other regex fixes