MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / findUnescapedSlashes

Function findUnescapedSlashes

static/js/codemirror/keymap/vim.js:1945–1956  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1943 }
1944 }
1945 function findUnescapedSlashes(str) {
1946 var escapeNextChar = false;
1947 var slashes = [];
1948 for (var i = 0; i < str.length; i++) {
1949 var c = str.charAt(i);
1950 if (!escapeNextChar && c == '/') {
1951 slashes.push(i);
1952 }
1953 escapeNextChar = (c == '\\');
1954 }
1955 return slashes;
1956 }
1957 /**
1958 * Extract the regular expression from the query and return a Regexp object.
1959 * Returns null if the query is blank.

Callers 2

parseQueryFunction · 0.85
VimFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected