Imagine I have RichEditBox string length of 100 and have 10 links set to different sets from the string, now how to extract all the ranges of those 10 Links and the contents of the Links. I have set the links for the RichEditBox in this way
RichEditBox.TextDocument.Selection.StartPosition = 10;
RichEditBox.TextDocument.Selection.EndPosition = 16;
RichEditBox.TextDocument.Selection.Link = "\"www.google.com\"";
Here is a solution, use
TextGetOptions.FormatRtfto get the text content in Rtf format.Text -->"This is some sample text", its Rtf format is as follows.
Then use regular expressions
(?<={HYPERLINK).*?(?=})and(?<=cf2).*?(?=})to get the links and link content.