# Compare patterns in byte array

**URL:** <https://discourse.julialang.org/t/compare-patterns-in-byte-array/55463>\
**Category:** New to Julia\
**Created:** [February 17, 2021, 2:29pm UTC](https://discourse.julialang.org/t/compare-patterns-in-byte-array/55463 "2021-02-17T14:29:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 19, 2021, 1:07pm UTC](https://discourse.julialang.org/t/compare-patterns-in-byte-array/55463/4 "2021-02-19T13:07:18Z")

</div>

> [@Michal](#):
>
> How can I find the position in array “a”, where is pattern match from array “b”? Does standard library have implemented this functionality?

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

```julia
julia> findfirst(b, a)
4:6

```

See also this discussion: [Finding position of a sequence in a UInt8 array?](https://discourse.julialang.org/t/finding-position-of-a-sequence-in-a-uint8-array/45757) which resulted in this PR: [https://github.com/JuliaLang/julia/pull/37283](https://github.com/JuliaLang/julia/pull/37283)

---

_[View the full topic](https://discourse.julialang.org/t/compare-patterns-in-byte-array/55463)._
