From c077dad6c933da541925f66b063e6d7884f4fb26 Mon Sep 17 00:00:00 2001 From: Rafael Fourquet Date: Sun, 24 Dec 2017 12:18:34 +0100 Subject: [PATCH] fix a couple replace(::String,...) from #25165 (#25260) --- base/precompile.jl | 6 +++--- doc/src/manual/strings.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/base/precompile.jl b/base/precompile.jl index 042525065f472..dcd614ba8fbf4 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -465,7 +465,7 @@ precompile(Tuple{typeof(Base.LineEdit.edit_insert), Base.LineEdit.PromptState, S precompile(Tuple{typeof(Base.Terminals.width), Base.Terminals.TTYTerminal}) precompile(Tuple{Type{Base.Libc.TmStruct}, Float64}) precompile(Tuple{typeof(Base.Libc.strftime), String, Base.Libc.TmStruct}) -precompile(Tuple{typeof(Base.replace), String, Base.Regex, String, Int64}) +precompile(Tuple{typeof(Base.replace), String, Pair{Base.Regex,String}}) precompile(Tuple{typeof(Base.REPL.mode_idx), Base.REPL.REPLHistoryProvider, Base.LineEdit.Prompt}) precompile(Tuple{typeof(Base.LineEdit.commit_line), Base.LineEdit.MIState}) precompile(Tuple{typeof(Base.LineEdit.on_enter), Base.LineEdit.PromptState}) @@ -951,7 +951,7 @@ precompile(Tuple{typeof(Base.Markdown.footnote), Base.GenericIOBuffer{Array{UInt precompile(Tuple{Type{Base.Markdown.Footnote}, Nothing, Array{Any, 1}}) precompile(Tuple{Type{Base.Markdown.Footnote}, Base.SubString{String}, Array{Any, 1}}) precompile(Tuple{typeof(Base.Markdown.github_table), Base.GenericIOBuffer{Array{UInt8, 1}}, Base.Markdown.MD}) -precompile(Tuple{typeof(Base.replace), String, String, String, Int64}) +precompile(Tuple{typeof(Base.replace), String, Pair{String,String}}) precompile(Tuple{typeof(Base.pop!), Array{Base.SubString{String}, 1}}) precompile(Tuple{typeof(Base.union!), Base.Set{Char}, String}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Char, Nothing}, Char}) @@ -1022,7 +1022,7 @@ precompile(Tuple{typeof(Base.throw_boundserror), Array{AbstractString, 1}, Tuple precompile(Tuple{typeof(Base.unsafe_copyto!), Array{AbstractString, 1}, Int64, Array{AbstractString, 1}, Int64, Int64}) precompile(Tuple{typeof(Base.start), Array{AbstractString, 1}}) precompile(Tuple{typeof(Base.done), Array{AbstractString, 1}, Int64}) -precompile(Tuple{typeof(Base.replace), String, Base.Regex, String}) +precompile(Tuple{typeof(Base.replace), String, Pair{Base.Regex,String}}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.Cmd, Symbol}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Cmd, Symbol, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Bool, Symbol}) diff --git a/doc/src/manual/strings.md b/doc/src/manual/strings.md index 2f8f89110436a..37e36f548f01b 100644 --- a/doc/src/manual/strings.md +++ b/doc/src/manual/strings.md @@ -746,14 +746,14 @@ to refer to the nth capture group and prefixing the substitution string with `s` with `g`. For example: ```jldoctest -julia> replace("first second", r"(\w+) (?\w+)", s"\g \1") +julia> replace("first second", r"(\w+) (?\w+)" => s"\g \1") "second first" ``` Numbered capture groups can also be referenced as `\g` for disambiguation, as in: ```jldoctest -julia> replace("a", r".", s"\g<0>1") +julia> replace("a", r"." => s"\g<0>1") "a1" ```