Restored the $ regex string terminator for the WriteContext test