Regular expression (regex) for updating to `where` syntax


#1

I thought the following would be useful for those updating packages to 0.7, which has deprecated the old syntax f{T}(x::T) in favour of using where f(x::T) where T. These are two regular expressions that I use in Atom’s search field, where the first line is what is searched for and the second line the replacement rule:

([^{\n(]*)(\{[^\n}]*\})\(([^\n]*)=
$1($3where $2 =
function ([^{\n(]*)(\{[^\n}]*\})\(([^\n]*)\n
function $1($3 where $2\n

These are not perfect, so I suggest checking the replacement one at a time.


#2

PSA: Parametric method syntax deprecation about to drop also has some nice stuff