function replaceMarkdownLinksWithHTML(markdownText) {
// Regex: \[([^\]]+)\]\(([^\)]+)\)
// Explanation:
// \[([^\]]+)\] -> Matches [text] where text is group 1
// \(([^\]]+)\) -> Matches (url) where url is group 2
const markdownLinkRegex = /\[([^\]]+)\]\(([^\)]+)\)/g;
return markdownText.replace(markdownLinkRegex, '$1');
}
// Example usage:
// const text = "Here is a [link to Google](https://www.google.com) and another [example](http://example.org).";
// console.log(replaceMarkdownLinksWithHTML(text));
// Output: "Here is a link to Google and another example."