hacky fix for bug where a document thats indexed without paying attention to underscores or symbols can result in a token not being surrounded by spaces as expected. also fixes a bug with matching backslashes in document fragment formatter