Here’s a quick regular expression for finding and replacing CDATA sections in an XML file, using Vim editor. ViM’s regex syntax is slightly different than Perl’s and I had to spend a little while to come up with this expression. Hope this helps somebody, some day.
%s/<!\[CDATA\_.\{-}\]\]>//c
Here’s the key items explained:
\_Matches any single character or the end-of-line.\{-}Matches zero or more of the preceding atom, as few times as possible./cConfirm before replace, you can as well use/gto do at one shot without any confirmation.