Using Regular Expressions To Find words in bold

Creating macros. Working with QM.

Using Regular Expressions To Find words in bold

Postby ssimop on Sun Oct 01, 2017 1:13 pm

I wonder whether there exists a QM routine to find find words in bold, in a rich edit control. Any advice is mostly welcome.
User avatar
ssimop
Active Member
 
Posts: 913
Joined: Sun Oct 21, 2007 1:55 pm
Location: Greece

Re: Using Regular Expressions To Find words in bold

Postby Gintaras on Sun Oct 01, 2017 5:32 pm

Does not exist. Regular expression probably can be created.
Gintaras
Site Admin
 
Posts: 10385
Joined: Thu Dec 19, 2002 7:36 pm
Location: Lithuania

Re: Using Regular Expressions To Find words in bold

Postby ssimop on Sun Oct 01, 2017 5:50 pm

Thank you, I will try it.
User avatar
ssimop
Active Member
 
Posts: 913
Joined: Sun Oct 21, 2007 1:55 pm
Location: Greece

Re: Using Regular Expressions To Find words in bold

Postby ssimop on Tue Oct 03, 2017 5:26 pm

This is my approach. Any comments are welcome.

Member function str.BoldInRichE     ?
function# ARRAY(str)&ar

;
;---> Comment 03-10-2017 20:11:55 : Find bold in Rich Edit String
;www.quickmacros.com/forum/viewtopic.php?f=1&t=7208

ARRAY(str) a; int i
str s=this
str rx
rx="\\[b].+?\\[b^0]"
if findrx(s rx 0 4|8 a)<0 ; ret 0
str st
int n=a.len
;out n

for i 0 n
,st=a[0 i]
,st.trim("\b")
,outt F"{i+1}. {st}"
,ar[]=st
ret n


User avatar
ssimop
Active Member
 
Posts: 913
Joined: Sun Oct 21, 2007 1:55 pm
Location: Greece


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron