function foo() {
  
}

// misc
var foo = "asdf";
var bar = 1E2

// objects
var foo = bar.asdf;
var foo = bar.asdf.bla;
bar.func(adsf.bar);
var foo = asdf. asdf . asdf ;
var a = foo.bar
var b = z // var here not an object

// no regular expression
var foo = foo.i / 0;
var bar = bar / 1;
var foo = bar / 1; bar / 1;

// regular expressions
foo = /asdf/i;
foo = /asdf/ig;
foo = /asdf/gi;
foo = /asdf\/asdf/;

function foo() {
  
}

// misc
var foo = "asdf";
var bar = 1E2

// objects
var foo = bar.asdf;
var foo = bar.asdf.bla;
bar.func(adsf.bar);
var foo = bar
  . asdf;
var foo = asdf. asdf
  . asdf ;
var a = foo.bar
var b = z // following var here not an object
var asdf = someObject().bar()
  .meh.bar;

// no regular expression
var foo = foo.i / 0;
var bar = bar / 1;
var foo = bar / 1; bar / 1;

// regular expressions
foo = /asdf/i;
foo = /asdf/ig;
foo = /asdf/gi;
foo = /asdf\/asdf/;

Extend highlight.js example