为有中文需求的客户提供多渠道中文技术支持.

Mon Mar 20, 2023 11:30 am

Code: Select all
Document document = new Document();
document.LoadFromFile(@"E:\Work\Documents\WordDocuments\New Zealand.docx");
document .FindString("^l(  )(1)", true, true);


以下為word內容範例 ?號後面有一個手動分行符號

流浪狗跟流浪貓,還有許多寵物被丟棄下列哪些是正確的做法?
(  )(1)確實栓好,避免走失
(  )(2)貓狗都需要活動

我想要找到 手動分行符號(  )(1) 所屬段落

你好我想問一下 Shift+Enter Spire.Doc 在 是甚麼符號
我有試過以下代碼是找的到的
Code: Select all
 Regex regex = new Regex(@"\(  \)\(1\)");
TextSelection[] textSelections1 = document.FindAllPattern(regex);


但改為以下代碼就找不到了
Code: Select all
Regex regex =  Regex(@"^l\(  \)\(1\)");
TextSelection[] textSelections1 = document.FindAllPattern(regex);
[/code]


此問題已解正確答案是
Code: Select all
Regex regex = new Regex(@"\v\(  \)\(1\)");
TextSelection[] textSelections1 = document.FindAllPattern(regex);
[/code]

yaowen2022
 
Posts: 17
Joined: Mon Mar 06, 2023 8:52 am

Tue Mar 21, 2023 9:46 am

你好,

感谢你的提问。
很高兴你已经找到了问题的答案,如果你还有其他问题,欢迎随时询问

Best Regards,
Herman
E-iceblue support team
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Return to 中文技术支持

cron