const REGEX_POS = /foo(?=bar)/

const a = REGEX_POS.test('foobar'); // true

const b = REGEX_POS.test('fooba'); // false

const REGEX_NEG = /\S+ (?!Cohen)/

const c = 'Haim Levi'.match(REGEX_NEG); //Haim

const d = 'Moshe Cohen'.match(REGEX_NEG); //Null

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.