make regex pattern non-greedy

The connect ".*~~" regex pattern matches other markup that uses "~~" such "~~NOTOC~~".