Documentation
¶
Overview ¶
Package bytesearch turns UI search queries into byte patterns and scans byte slices in either direction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindBytes ¶
FindBytes returns the index of pat in data at or after (forward) / at or before (backward) start, or -1.
func FindBytesFold ¶
FindBytesFold is FindBytes with optional ASCII case-insensitive matching. With fold=false it is FindBytes (the fast exact bytes.Index). With fold=true it matches letters ignoring ASCII case — for text patterns; a byte-value pattern (hex) simply won't contain letters to fold, so callers can always pass the view's case flag.
func IsTextPattern ¶
IsTextPattern reports whether ParsePattern would treat q as literal text (so case-folding is meaningful) rather than a hex byte pattern (where it isn't).
func ParsePattern ¶
ParsePattern interprets a query as bytes or text:
- "quoted text" -> literal bytes of the text
- hex digits / 0x -> byte pattern (spaces allowed: "de ad be ef")
- anything else -> literal text bytes