/^hello$/, you may want qui to match the word hello, but not other words containing hello. In this case, you only need one hello, or write it with abc and return false. You can also write two
Personally, I think it’s better to use /bhellob/, but this regular rule cannot be matched very accurately. It can only satisfy most situations, not special situations. This is because js’s support for regular expressions is not perfect enough, so you can make do with it for now
/^hello$/, you may want qui to match the word hello, but not other words containing hello. In this case, you only need one hello, or write it with abc and return false. You can also write two
js does not have lookahead, it can only be determined through two matches.
/^hello$/ig.test('abchello'); //false
/hello$/ig.test('abchello'); //true
Cause:
Personally, I think it’s better to use
/bhellob/
, but this regular rule cannot be matched very accurately. It can only satisfy most situations, not special situations. This is because js’s support for regular expressions is not perfect enough, so you can make do with it for now