Solve the () (?:) (? =) (?!) in the regular expression. What does it mean?

RT

<script>
    let reg = "abca";
    console.log(reg.match(/(a)/));
    console.log(reg.match(/(?:a)/));
    console.log(reg.match(/(?=a)/));
    console.log(reg.match(/(?!a)/));
</script>

clipboard.png

is this clear enough?

Zero width assertion
simply put, my goal is in front of / behind the xxx, but I don't want to match the xxx

.
Menu