A regular expression matches a string

has the following string: ab Ac126 Hello 123-sharp 121a No bc13ab Hello a1b35-sharp a791 Ah 326bop Hello cagf1-sharp 38a good 1

needs to match so that does not contain the string "Hello. *?-sharp" (the character between "Hello" and "- sharp" is a variable). The matching result is as follows:
ab A c126121a does not bc13aba791, 326bop38a good 1

could you tell me how to write the corresponding rules?
I use [^ Hello. *?-sharp] to match, and the intermediate variables also match

.
Apr.03,2021

it's faster and easier to use replace in this scenario! It does not change the original string. It is difficult to match all the strings of that are not a character string using js's rules alone, so I recommend you use reverse thinking to replace the strings you want to exclude.

var x= 'abc126123-sharp121abc13aba1b35-sharpa791326bopcagf1-sharp38a1';
var y = x.replace(/.*?-sharp/g, "");
console.log(y);

var str = 'abc126123-sharpa791abc13aba1b35-sharpa791326bopcagf1-sharpa791'
var newStr = str.replace(/[\u4f60|\u597d|\.|\*|\?|\-sharp]/g, '');

console.log(newStr); 
// 'abc126a791abc13aba791326bopa791'

unicode.*?-sharp

var str="abc126123-sharp121abc13aba1b35-sharpa791326bopcagf1-sharp38a1";
str.split(/[^-sharp]*-sharp/);

or

var str="abc126123-sharp121abc13aba1b35-sharpa791326bopcagf1-sharp38a1";
str.replace(/[^-sharp]*-sharp/g,"");
Menu