Hello, i have a simple notepad application where i want a feature of selecting text which is underlined. Usually what happens is when i click a button the app reads a text file and underlines random text in the richtextbox. What i want is on the click of another button to select the text which is underlined. I thought of creating char range, regex all but not getting anywhere. I also dunno how to build a regex.
What i know is since all RTF texts are different we can choose the rtf text instead of simple text to select the underlined text. The rtf of underlined text in my application is this :
where ul and ulnone mark the text as underlined. Now i want to select all such texts which are surrounded by \ul\i0 and \ulnone\i . I thought of the following method :
1) Create another richtextbox2
2) Paste the text of richtextbox1 as rtf in richtextbox2. I mean show the text in coded rtf (like above) instead of normal rtf.
3) Use simple find to select all the text which is surrounded by ul and ulnone tags
4) process the text.
But this step is very tedious. If anyone could help me in making a simple procedure or build a regex which could process the text surrounded by those tags, i would be very thankful.
What i know is since all RTF texts are different we can choose the rtf text instead of simple text to select the underlined text. The rtf of underlined text in my application is this :
VB.NET:
\ul\i0 so many\ulnone\i
where ul and ulnone mark the text as underlined. Now i want to select all such texts which are surrounded by \ul\i0 and \ulnone\i . I thought of the following method :
1) Create another richtextbox2
2) Paste the text of richtextbox1 as rtf in richtextbox2. I mean show the text in coded rtf (like above) instead of normal rtf.
3) Use simple find to select all the text which is surrounded by ul and ulnone tags
4) process the text.
But this step is very tedious. If anyone could help me in making a simple procedure or build a regex which could process the text surrounded by those tags, i would be very thankful.
Last edited: