Corrected indexOf to ignore all backslash escapes, not just marker-related