MCPcopy Create free account
hub / github.com/google/codesearch / isWordByte

Function isWordByte

regexp/match.go:344–349  ·  view source on GitHub ↗

isWordByte reports whether the byte c is a word character: ASCII only. This is used to implement \b and \B. This is not right for Unicode, but: - it's hard to get right in a byte-at-a-time matching world (the DFA has only one-byte lookahead) - this crude approximation is the same one PCRE uses

(c int)

Source from the content-addressed store, hash-verified

342// (the DFA has only one-byte lookahead)
343// - this crude approximation is the same one PCRE uses
344func isWordByte(c int) bool {
345 return 'A' <= c && c <= 'Z' ||
346 'a' <= c && c <= 'z' ||
347 '0' <= c && c <= '9' ||
348 c == '_'
349}
350
351// TODO:
352type Grep struct {

Callers 1

computeNextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…