I have a string. I need to remove render_dynamic_content(, leave the text and then remove next ) from the string. The text inside the pattern can be different.
Example:
some ( text {{ render_dynamic_content(dynamic_html.POS_A_IMG) }} another ) text {{ render_dynamic_content(dynamic_html.POS_B_IMG) }}
Expected result should be:
some ( text {{ dynamic_html.POS_A_IMG }} another ) text {{ dynamic_html.POS_B_IMG }}
I'm trying:
$string = 'some ( text {{ render_dynamic_content(dynamic_html.POS_A_IMG) }} another ) text {{ render_dynamic_content(dynamic_html.POS_B_IMG) }}';
$content = preg_replace('/render_dynamic_content([\s\S]+?)/', '', $string);
The result is:
some ( text {{ dynamic_html.POS_A_IMG) }} another ) text {{ dynamic_html.POS_B_IMG) }}
I need to remove ) after dynamic_html.POS_A_IMG and dynamic_html.POS_B_IMG