Improved regex detection/delimiters