Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jul 27, 2017 2:39 pm

Hi, I'm not able to bring a block by regex, where I'm failing?

my block in word:

"V – COMPOSIÇÃO DA RENDA DO(S) COMPRADOR(ES):
[#loopParticipantes#][#nome_do_comprador#] [#percentual_participacao_proponente#]

[#casado#]- [#nome_do_conjuge#] [#percentual_participacao_proponente#] [#/loopParticipantes#]"

My code C#:

Regex regex = new Regex(@"\[#loopParticipantes\b[^#\]]*#\](.*?)(.|\s)*\[#/loopParticipantes#\]");
doc.FindPattern(regex) is null

I tested this condition in site regexstorm.net and work fine.

My version Spire.doc: 4.4.6.3040

maycon
 
Posts: 3
Joined: Mon Jul 24, 2017 1:25 pm

Fri Jul 28, 2017 2:16 am

Dear maycon,

Thanks for your inquiry.
I used the latest Spire.Doc Pack(hot fix) Version:6.0.3 to have a test, and it returns correct value, so please use this version.
If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Aug 02, 2017 8:00 am

Dear maycon,

Did you test the hotfix ?
Has your issue been resolved ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Aug 02, 2017 12:38 pm

Hello, I didn't tested the last version.
The company that I work for generates a lot of contracts per year, exists five thousands of code lines and is stable in this version.
I solved the problem applying spaces as needed an enter, and FindPattern found out and solved my problem.

maycon
 
Posts: 3
Joined: Mon Jul 24, 2017 1:25 pm

Thu Aug 03, 2017 1:21 am

Dear maycon,

Glad to hear that you have solved the issue.
Please do not hesitate to contact us if there is any question.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc