Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Regular Expressions To Find words in bold
#1
I wonder whether there exists a QM routine to find find words in bold, in a rich edit control. Any advice is mostly welcome.
#2
Does not exist. Regular expression probably can be created.
#3
Thank you, I will try it.
#4
This is my approach. Any comments are welcome.

Member function str.BoldInRichE
Code:
Copy      Help
function# ARRAY(str)&ar

;
;---> Comment 03-10-2017 20:11:55 : Find bold in Rich Edit String
;www.quickmacros.com/forum/viewtopic.php?p=33256

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


Forum Jump:


Users browsing this thread: 1 Guest(s)