Uh, hard to read to me. May I propose something like:
```
pathSeparatorTest = path.sep !== "/" ? /\// : /[\/\\]/;
while (langs[0] && langs[0].match(pathSeparatorTest)) {
```
Untested, but feels quicker to grasp by some future reader.