The [
and ]
mean you're defining a character class.
If those <
and >
are really there, then:
var str = str.replace(/<<<<<(.+?)>>>>/, '');
The .+?
means "a non-greedy match for one or more characters" (if we left off the ?
, it would be greedy, and so might match some of the >
following it and make the expression not match).
That will replace the first place that text appears with nothing, leaving you with just what's before and after it.
If that text may appear in more than one place, add the global flag to the regex:
var str = str.replace(/<<<<<(.+?)>>>>/g, '');