Forum Academy Marketplace Showcase Pricing Features

Extract with Regex or Find & Replace

I’m trying to figure out how I could set things up so that when I use a Rich Text Editor to add a link and choose a color (or not choose a color) to automatically change the color to a ‘primary color’ for my app.

[url=][color= rgb(230, 0, 0)]

What I am unsure of is how I could account for the fact that the url is unknown and the color value is unknown, but would need to search a paragraph to find those values to replace the rgb value with those that match my apps primary color and in the case that there is not a color applied to automatically apply a color.