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)
| 342 | // (the DFA has only one-byte lookahead) |
| 343 | // - this crude approximation is the same one PCRE uses |
| 344 | func 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: |
| 352 | type Grep struct { |
no outgoing calls
no test coverage detected
searching dependent graphs…