Compare patterns in byte array

In Julia 1.6 you can use findfirst and findnext for this:

julia> findfirst(b, a)
4:6

See also this discussion: Finding position of a sequence in a UInt8 array? which resulted in this PR: https://github.com/JuliaLang/julia/pull/37283

3 Likes