function count_leading_backslashes(string, search_start_index) {
	let i = search_start_index;
	let count = 0;
	while (string[i] === '\\') {
		count++;
		i--;
	}
	return count;
}
Count consecutive leading backslashes before {@link search_start_index}.

@example
```js
count_leading_backslashes('\\\\\\foo', 2); // 3 (the backslashes have to be escaped in the string literal, there are three in reality)
```

@param {string} string The string to search.
@param {number} search_start_index The index to begin the search at.