Changes Write() method to use compiled regex's