diff --git a/lib/repl.js b/lib/repl.js index 5e6de2f720..fcd65e0ca6 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -266,8 +266,8 @@ REPLServer.prototype.complete = function (line) { // spam.eggs.<|> # completions for 'spam.eggs' with filter '' // foo<|> # all scope vars with filter 'foo' // foo.<|> # completions for 'foo' with filter '' - else if (line.length === 0 || line[line.length-1].match(/\w|\./)) { - var simpleExpressionPat = /(([a-zA-Z_]\w*)\.)*([a-zA-Z_]\w*)\.?$/; + else if (line.length === 0 || line[line.length-1].match(/\w|\.|\$/)) { + var simpleExpressionPat = /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/; match = simpleExpressionPat.exec(line); if (line.length === 0 || match) { var expr;