title: Regex pattern to find matches that start with [vc or [/vc and end with "] or ]
body: <p>As the title suggests I am looking to build a regex (JS flavour for VSCode find in file) that finds matches that start with <code>[vc_</code> or <code>[/vc</code> and end with <code>&quot;]</code> or <code>]</code>. I am attempting to clean up data coming from WP Bakery so it can be imported into the WordPress TinyMCE editor. And example of the exported content is as follows (apologies for the length, but its to give an idea of the strings I am working with):</p>
  <pre><code>&lt;content:encoded&gt;
  &lt;![CDATA[[vc_row type=&quot;in_container&quot; full_screen_row_position=&quot;middle&quot; column_margin=&quot;default&quot; column_direction=&quot;default&quot; column_direction_tablet=&quot;default&quot; column_direction_phone=&quot;default&quot; scene_position=&quot;center&quot; text_color=&quot;dark&quot; text_align=&quot;left&quot; row_border_radius=&quot;none&quot; row_border_radius_applies=&quot;bg&quot; overlay_strength=&quot;0.3&quot; gradient_direction=&quot;left_to_right&quot; shape_divider_position=&quot;bottom&quot; bg_image_animation=&quot;none&quot;][vc_column column_padding=&quot;no-extra-padding&quot; column_padding_tablet=&quot;inherit&quot; column_padding_phone=&quot;inherit&quot; column_padding_position=&quot;all&quot; background_color_opacity=&quot;1&quot; background_hover_color_opacity=&quot;1&quot; column_shadow=&quot;none&quot; column_border_radius=&quot;none&quot; column_link_target=&quot;_self&quot; gradient_direction=&quot;left_to_right&quot; overlay_strength=&quot;0.3&quot; width=&quot;1/1&quot; tablet_width_inherit=&quot;default&quot; tablet_text_alignment=&quot;default&quot; phone_text_alignment=&quot;default&quot; column_border_width=&quot;none&quot; column_border_style=&quot;solid&quot; bg_image_animation=&quot;none&quot;][vc_column_text]Duis posuere diam eu eleifend tristique. Morbi tincidunt leo sit amet diam ultricies elementum.[/vc_column_text][/vc_column][/vc_row][vc_row type=&quot;in_container&quot; full_screen_row_position=&quot;middle&quot; column_margin=&quot;default&quot; column_direction=&quot;default&quot; column_direction_tablet=&quot;default&quot; column_direction_phone=&quot;default&quot; scene_position=&quot;center&quot; text_color=&quot;dark&quot; text_align=&quot;left&quot; row_border_radius=&quot;none&quot; row_border_radius_applies=&quot;bg&quot; overlay_strength=&quot;0.3&quot; gradient_direction=&quot;left_to_right&quot; shape_divider_position=&quot;bottom&quot; bg_image_animation=&quot;none&quot;][vc_column column_padding=&quot;no-extra-padding&quot; column_padding_tablet=&quot;inherit&quot; column_padding_phone=&quot;inherit&quot; column_padding_position=&quot;all&quot; background_color_opacity=&quot;1&quot; background_hover_color_opacity=&quot;1&quot; column_shadow=&quot;none&quot; column_border_radius=&quot;none&quot; column_link_target=&quot;_self&quot; gradient_direction=&quot;left_to_right&quot; overlay_strength=&quot;0.3&quot; width=&quot;1/1&quot; tablet_width_inherit=&quot;default&quot; tablet_text_alignment=&quot;default&quot; phone_text_alignment=&quot;default&quot; column_border_width=&quot;none&quot; column_border_style=&quot;solid&quot; bg_image_animation=&quot;none&quot;][vc_column_text]&lt;strong&gt;Duis posuere diam eu eleifend tristique. Morbi tincidunt leo sit amet diam ultricies elementum.&lt;/strong&gt;
  
  Duis posuere diam eu eleifend tristique. Morbi tincidunt leo sit amet diam ultricies elementum.[/vc_column_text][/vc_column][/vc_row][vc_row type=&quot;in_container&quot; full_screen_row_position=&quot;middle&quot; column_margin=&quot;default&quot; column_direction=&quot;default&quot; column_direction_tablet=&quot;default&quot; column_direction_phone=&quot;default&quot; scene_position=&quot;center&quot; text_color=&quot;dark&quot; text_align=&quot;left&quot; row_border_radius=&quot;none&quot; row_border_radius_applies=&quot;bg&quot; overlay_strength=&quot;0.3&quot; gradient_direction=&quot;left_to_right&quot; shape_divider_position=&quot;bottom&quot; bg_image_animation=&quot;none&quot;][vc_column column_padding=&quot;no-extra-padding&quot; column_padding_tablet=&quot;inherit&quot; column_padding_phone=&quot;inherit&quot; column_padding_position=&quot;all&quot; background_color_opacity=&quot;1&quot; background_hover_color_opacity=&quot;1&quot; column_shadow=&quot;none&quot; column_border_radius=&quot;none&quot; column_link_target=&quot;_self&quot; gradient_direction=&quot;left_to_right&quot; overlay_strength=&quot;0.3&quot; width=&quot;1/1&quot; tablet_width_inherit=&quot;default&quot; tablet_text_alignment=&quot;default&quot; phone_text_alignment=&quot;default&quot; column_border_width=&quot;none&quot; column_border_style=&quot;solid&quot; bg_image_animation=&quot;none&quot;][divider line_type=&quot;No Line&quot;][/vc_column][/vc_row][vc_row type=&quot;in_container&quot; full_screen_row_position=&quot;middle&quot; column_margin=&quot;default&quot; column_direction=&quot;default&quot; column_direction_tablet=&quot;default&quot; column_direction_phone=&quot;default&quot; scene_position=&quot;center&quot; text_color=&quot;dark&quot; text_align=&quot;left&quot; row_border_radius=&quot;none&quot; row_border_radius_applies=&quot;bg&quot; overlay_strength=&quot;0.3&quot; gradient_direction=&quot;left_to_right&quot; shape_divider_position=&quot;bottom&quot; bg_image_animation=&quot;none&quot;][vc_column column_padding=&quot;no-extra-padding&quot; column_padding_tablet=&quot;inherit&quot; column_padding_phone=&quot;inherit&quot; column_padding_position=&quot;all&quot; background_color_opacity=&quot;1&quot; background_hover_color_opacity=&quot;1&quot; column_shadow=&quot;none&quot; column_border_radius=&quot;none&quot; column_link_target=&quot;_self&quot; gradient_direction=&quot;left_to_right&quot; overlay_strength=&quot;0.3&quot; width=&quot;1/1&quot; tablet_width_inherit=&quot;default&quot; tablet_text_alignment=&quot;default&quot; phone_text_alignment=&quot;default&quot; column_border_width=&quot;none&quot; column_border_style=&quot;solid&quot; bg_image_animation=&quot;none&quot;][vc_column_text]&lt;strong&gt;Duis posuere diam eu eleifend tristique. Morbi tincidunt leo sit amet diam ultricies elementum.&lt;/strong&gt;[/vc_column_text][/vc_column][/vc_row][vc_row type=&quot;in_container&quot; full_screen_row_position=&quot;middle&quot; column_margin=&quot;default&quot; column_direction=&quot;default&quot; column_direction_tablet=&quot;default&quot; column_direction_phone=&quot;default&quot; scene_position=&quot;center&quot; text_color=&quot;dark&quot; text_align=&quot;left&quot; row_border_radius=&quot;none&quot; row_border_radius_applies=&quot;bg&quot; overlay_strength=&quot;0.3&quot; gradient_direction=&quot;left_to_right&quot; shape_divider_position=&quot;bottom&quot; bg_image_animation=&quot;none&quot;][vc_column column_padding=&quot;no-extra-padding&quot; column_padding_tablet=&quot;inherit&quot; column_padding_phone=&quot;inherit&quot; column_padding_position=&quot;all&quot; background_color_opacity=&quot;1&quot; background_hover_color_opacity=&quot;1&quot; column_shadow=&quot;none&quot; column_border_radius=&quot;none&quot; column_link_target=&quot;_self&quot; gradient_direction=&quot;left_to_right&quot; overlay_strength=&quot;0.3&quot; width=&quot;1/1&quot; tablet_width_inherit=&quot;default&quot; tablet_text_alignment=&quot;default&quot; phone_text_alignment=&quot;default&quot; column_border_width=&quot;none&quot; column_border_style=&quot;solid&quot; bg_image_animation=&quot;none&quot;][divider line_type=&quot;No Line&quot;][/vc_column][/vc_row][vc_row type=&quot;in_container&quot; full_screen_row_position=&quot;middle&quot; column_margin=&quot;default&quot; column_direction=&quot;default&quot; column_direction_tablet=&quot;default&quot; column_direction_phone=&quot;default&quot; scene_position=&quot;center&quot; text_color=&quot;dark&quot; text_align=&quot;left&quot; row_border_radius=&quot;none&quot; row_border_radius_applies=&quot;bg&quot; overlay_strength=&quot;0.3&quot; gradient_direction=&quot;left_to_right&quot; shape_divider_position=&quot;bottom&quot; bg_image_animation=&quot;none&quot;][vc_column column_padding=&quot;no-extra-padding&quot; column_padding_tablet=&quot;inherit&quot; column_padding_phone=&quot;inherit&quot; column_padding_position=&quot;all&quot; background_color_opacity=&quot;1&quot; background_hover_color_opacity=&quot;1&quot; column_shadow=&quot;none&quot; column_border_radius=&quot;none&quot; column_link_target=&quot;_self&quot; gradient_direction=&quot;left_to_right&quot; overlay_strength=&quot;0.3&quot; width=&quot;1/1&quot; tablet_width_inherit=&quot;default&quot; tablet_text_alignment=&quot;default&quot; phone_text_alignment=&quot;default&quot; column_border_width=&quot;none&quot; column_border_style=&quot;solid&quot; bg_image_animation=&quot;none&quot;][vc_column_text]Duis posuere diam eu eleifend tristique. Morbi tincidunt leo sit amet diam ultricies elementum.[/vc_column_text][/vc_column][/vc_row]]]&gt;&lt;/content:encoded&gt;
  
  </code></pre>
  <p>So, I have been attempting various regex to find these 'vc' tags, but what I have been using does not find the end of each tag, it finds the end of the tag for that particular string.</p>
  <p>The expression I have been using so far - <code>(\[vc|\[\/vc).*(\&quot;]|\])</code>.</p>
  <p>Any help with this would be appreciated.</p>