Documentation ¶
Index ¶
- Constants
- func GUIDTest(sr *wizutil.SliceReader, targetIndex int64, patternUUIDString string) int64
- func IntToBytes(n int) []byte
- func PStringTest(sr *wizutil.SliceReader, targetIndex int64, LengthByte int, pattern string, ...) int64
- func RegexTest(sr *wizutil.SliceReader, targetIndex int64, maxLen int64, regexString string, ...) int64
- func SearchTest(sr *wizutil.SliceReader, targetIndex int64, maxLen int64, pattern string) int64
- func StringTest(sr *wizutil.SliceReader, targetIndex int64, patternString string, ...) int64
- type RegexTestFlags
- type StringFinder
- type StringTestFlags
Constants ¶
const ( Case_insensitive = 1 << iota Match_To_Start Limit_Lines Trim )
const ( // CompactWhitespace ("W" flag) compacts whitespace in the target, // which must contain at least one whitespace character CompactWhitespace = 1 << iota // OptionalBlanks ("w" flag) treats every blank in the magic as an optional blank OptionalBlanks // LowerMatchesBoth ("c" flag) specifies case-insensitive matching: lower case // characters in the magic match both lower and upper case characters // in the target LowerMatchesBoth // UpperMatchesBoth ("C" flag) specifies case-insensitive matching: upper case // characters in the magic match both lower and upper case characters // in the target UpperMatchesBoth // ForceText ("t" flag) forces the test to be done for text files ForceText // ForceBinary ("b" flag) forces the test to be done for binary files ForceBinary )
Variables ¶
This section is empty.
Functions ¶
func GUIDTest ¶
func GUIDTest(sr *wizutil.SliceReader, targetIndex int64, patternUUIDString string) int64
StringTest looks for a string pattern in target, at given index
func IntToBytes ¶
func PStringTest ¶
func PStringTest(sr *wizutil.SliceReader, targetIndex int64, LengthByte int, pattern string, EndiannessBIG bool, ContainsOwnLength bool) int64
pstringTest looks for a fixed pattern at any position within a certain length
func RegexTest ¶
func RegexTest(sr *wizutil.SliceReader, targetIndex int64, maxLen int64, regexString string, flags RegexTestFlags) int64
StringTest looks for a string pattern in target, at given index
func SearchTest ¶
SearchTest looks for a fixed pattern at any position within a certain length
func StringTest ¶
func StringTest(sr *wizutil.SliceReader, targetIndex int64, patternString string, flags StringTestFlags) int64
StringTest looks for a string pattern in target, at given index
Types ¶
type RegexTestFlags ¶
type RegexTestFlags int64
type StringFinder ¶
type StringFinder struct {
// contains filtered or unexported fields
}
StringFinder efficiently finds strings in a source text. It's implemented using the Boyer-Moore string search algorithm: http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm http://www.cs.utexas.edu/~moore/publications/fstrpos.pdf (note: this aged document uses 1-based indexing)
func MakeStringFinder ¶
func MakeStringFinder(pattern string) *StringFinder
MakeStringFinder prepares a finder for a given pattern
type StringTestFlags ¶
type StringTestFlags int64
StringTestFlags describes how to perform a string test