const regex = /(^|>)[^<]+/g;
const test = `abcd<App>ew <View id="view1" visible="true">4</View>- <View id="view1" visible="true" width="100">WORD</View>s</App>abcd`;
console.log(test.replace(regex, "$1"));
I really like regex101.com for figuring things like this out. It has a searchable quick reference and also an explanation of how your current regex is working and what it's matching.
This one matches either the start of the string or a literal > character in a group, followed by 1 or more characters that are not <. It uses the global
regex option to allow it to find all matches instead of stopping after the first one.
Then you replace all matches found a reference to group 1 ($1). This handles anything before the first element, after the last element, or in between XML elements.
Here is a link to regex101.com with this regular expression so you can see their explanation, since it will be better than mine.
https://regex101.com/r/NgiyTZ/1