I have this code,but there is an error
“NotSupportedException The
match includes one or more special or break characters and cannot be replaced.”
There is an error in regular expressions?
I want to get all characters do not include return
foreach(Aspose.Words.Paragraph p in doc.Sections[0].Body.Paragraphs)
{
p.Range.Replace(@"(?s).*", "fa");
}
I want to replace special characters(.) in the paragraph,for example:
The source:“This /is /word/ 1/1,a/a this is”
The target: “This /is /word/ 1.1,a/a this is”
but use this code, no error
string pattern = @"(?s).*";
string text = "The threaded application ate up the thread pool as it executed.\r";
MatchCollection matches;
Regex defaultRegex = new Regex(pattern);
// Get matches of pattern in text
matches = defaultRegex.Matches(text);
string pattern = @"(?s).";
string text = "The threaded application ate up the thread pool as it executed.\r";
MatchCollection matches;
Regex defaultRegex = new Regex(pattern);
// Get matches of pattern in text
matches = defaultRegex.Matches(text);