I have html table td data with
id="ctlHoursReport_rptrHoursReport_tdMon_29",
id="ctlHoursReport_rptrHoursReport_tdTue_29",
id="ctlHoursReport_rptrHoursReport_tdWed_29",
etc. through to Sun. The number at the end is the row number of the table.
Each td represents a day of the week. I'd like to remove the entire id including the day abbreviation.
But I would like to keep the ids of the other tds in the row, eg. id="ctlHoursReport_rptrHoursReport_tdPayRate_29"
How can I put this into a single Regex.replace method?
[edit] This is what I put in so far. It works, but is really clunky:
html = Regex.Replace(html, "id=\"ctlHoursReport_rptrHoursReport_tdMon[^\"]+\"|id=\"ctlHoursReport_rptrHoursReport_tdTue[^\"]+\"|id=\"ctlHoursReport_rptrHoursReport_tdWed[^\"]+\"" +
"|id=\"ctlHoursReport_rptrHoursReport_tdThu[^\"]+\"|id=\"ctlHoursReport_rptrHoursReport_tdFri[^\"]+\"|id=\"ctlHoursReport_rptrHoursReport_tdSat[^\"]+\"" +
"|id=\"ctlHoursReport_rptrHoursReport_tdSun[^\"]+\"", String.Empty, RegexOptions.IgnoreCase);
[2nd edit] The ids I want to remove - days of the week begin with M, T, W, T, F, S, S. The ones I don't want to touch - PayRate, Reg, OT, begin with different letters.
So I was able to reduce the statement to:
html = Regex.Replace(html, "id=\"ctlHoursReport_rptrHoursReport_td[MTWFS].+[0-9]\"", String.Empty, RegexOptions.IgnoreCase);
So, it's cleaner, but what I would like to say is something like:
html = Regex.Replace(html, "id=\"ctlHoursReport_td[Mon,Tue,...Sun]_[0-9]\""