Skip to content

Commit

Permalink
Merge pull request #11633 from fcard/patch-2
Browse files Browse the repository at this point in the history
Deprecate old Regex constructor method (fixes #11593)
  • Loading branch information
tkelman committed Aug 14, 2015
2 parents e37f632 + 202a576 commit c71b83a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,19 @@ end

const FloatingPoint = AbstractFloat
export FloatingPoint

# 11447

function Regex(pattern::AbstractString, options::Integer)
flags = string([opt & options != 0? flag : ""
for (opt,flag) in [
(PCRE.CASELESS, "i"),
(PCRE.MULTILINE, "m"),
(PCRE.DOTALL, "s"),
(PCRE.EXTENDED, "x")
]
]...)
depwarn("Constructing regexes with integer flags is deprecated, "*
"use string flags instead: Regex(\"$pattern\", \"$flags\").", :Regex)
Regex(pattern, flags)
end

0 comments on commit c71b83a

Please sign in to comment.