Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when matching SubString of StringView with Regex #26

Closed
DatName opened this issue Jul 13, 2024 · 0 comments · Fixed by #27
Closed

TypeError when matching SubString of StringView with Regex #26

DatName opened this issue Jul 13, 2024 · 0 comments · Fixed by #27

Comments

@DatName
Copy link

DatName commented Jul 13, 2024

When using @view of StringView to match against some regex, I get an error

TypeError: in typeassert, expected SubString{SubString{StringView{Base.CodeUnits{UInt8, String}}}}, got a value of type SubString{StringView{Base.CodeUnits{UInt8, String}}}

Error comes from return type assert in convert(::Type{SubString{S}}, s::AbstractString) which is in julia' base.

MRE:

using StringViews
str_view = StringView("123-456")
match(r"(?<group>.*)", @view str_view[1:3])

Package version:

(@v1.10) pkg> st StringViews
Status `~/.julia/environments/v1.10/Project.toml`
  [354b36f9] StringViews v1.3.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant