I'm trying to highlight a piece of text in a "Textarea". I have a long string in that TextArea:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident
And I have a function that can extract the first string occurrence that is between the "begin" and "end" vars. For example:
extract("ipsum", "consectetur") // This will give: "dolor sit amet,"
But, what I want is to select the result of the function so the resulting string "dolor sit amet," will be highlighted.
Is it possible? How can I do this?
Thank you,
Regards.