Javascript doesn't have look-behind at all. Steven Levithan has written up a few says to sort of mimic it, which may be helpful.
I don't quite understand your example, because it seems as though this would fit the bill:
/^\s+(.+)lookbehind$/
...which matches one or more whitespace chars followed by one or more of any character (in a capture group) followed by the word "lookbehind". Used like this:
var str = " variable length lookbehind";
var match = /^\s+(.+)lookbehind$/.exec(str);
yeilds this array:
match[0]: | variable length lookbehind|
match[1]: |variable length|
In Javascript, the first entry in the array is the entire matched string, and the subsequent entries are the capture groups.
But you clearly have a good grasp of regex, so I'm not sure that's what you're looking for...
Something to be aware of in this general area is that a number of implementations of RegExp engines in Javascript don't quite handle \s
correctly (they miss out matching some whitespace chars above the ASCII range); see the S_REGEXP_WHITESPACE_CHARACTER_CLASS_BUGGY test here.