Method ReplaceRegex
ReplaceRegex(string, string, XlsxFindOptions?)
Replaces every match of a regular expression in the workbook's worksheets. See ReplaceRegex(string, string, XlsxFindOptions?).
public XlsxReplaceResult ReplaceRegex(string pattern, string replacement, XlsxFindOptions? options = null)
Parameters
patternstringThe .NET regular expression.
replacementstringThe replacement, in which
\(1</code> and <code>\){name}stand for what was captured.optionsXlsxFindOptionsHow to match, or null for the defaults.
Returns
- XlsxReplaceResult
What was replaced and what was skipped.
Exceptions
- ArgumentNullException
patternorreplacementis null.- ArgumentException
patternis not a valid regular expression.- RegexMatchTimeoutException
A match attempt exceeded RegexTimeout.
- InvalidDocumentException
A sheet's part is malformed.