Skip to content

expose findfirst(pattern::AbstractVector{T}, A::AbstractVector{T}) where {T<:Union{Int8,UInt8}} #37280

@stevengj

Description

@stevengj

We already have a function _searchindex to search for subsequences of byte arrays. It would be nice to expose this by adding corresponding methods to findfirst and findnext.

Although the current _seardhindex implementation only accepts Vector arguments, it looks like the implementation doesn't depend on the storage format, so the function signature could be easily widened to AbstractVector{<:Union{Int8,UInt8}} arguments. (You'll need to replace the sizeof calls with length, and maybe use firstindex to support non 1-based indexing.)

(See also the discussion on discourse.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIndicates a good issue for first-time contributors to Juliasearch & findThe find* family of functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions