change regex delimiter from ~ to #