From 46054486460c7a6b90a6fb20d99aaa2a383c8de1 Mon Sep 17 00:00:00 2001 From: singularitti Date: Mon, 17 Jul 2023 02:53:55 -0400 Subject: [PATCH] Fix `fparse` --- src/fparse.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fparse.jl b/src/fparse.jl index c013996..e5dea11 100644 --- a/src/fparse.jl +++ b/src/fparse.jl @@ -6,9 +6,9 @@ end fparse(::Type{T}, str::AbstractString) where {T<:Integer} = Base.parse(T, str) fparse(::Type{Float32}, str::AbstractString) = - Base.parse(Float32, replace(lowercase(str), r"(?<=[^e])(?=[+-])" => "f")) + Base.parse(Float32, replace(lowercase(str), r"(?<=[^E])(?=[+-])"i => "f")) fparse(::Type{Float64}, str::AbstractString) = - Base.parse(Float64, replace(lowercase(str), r"d"i => "e")) + Base.parse(Float64, replace(lowercase(str), r"D"i => "e")) function fparse(::Type{Complex{T}}, str::AbstractString) where {T<:AbstractFloat} if first(str) == '(' && last(str) == ')' && length(split(str, ',')) == 2 re, im = split(str[2:(end - 1)], ','; limit=2)