How to I rearrange AND delete text in regex?


I’m trying to convert BB Code into markdown. The problem is, I can’t figure out how to delete and rearrange text.

I have this:

[url=https://example.com/]Example[/url]

I want to take everything in between [url= and ] and everything in between ] and [/url]

and rearrange it as

[Example](https://example.com)

But when I try, it results in this:

[]()[](https://example.com)[]()[Example]()[]()

Source: JavaSript – Stack Overflow

November 28, 2021
Category : News
Tags: javascript | regex

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.