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

**URL:** https://discourse.julialang.org/t/regular-expression-regex-for-updating-to-where-syntax/5141
**Category:** General Usage
**Created:** [July 30, 2017, 7:26pm UTC](https://discourse.julialang.org/t/regular-expression-regex-for-updating-to-where-syntax/5141 "2017-07-30T19:26:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [July 30, 2017, 7:26pm UTC](https://discourse.julialang.org/t/regular-expression-regex-for-updating-to-where-syntax/5141/1 "2017-07-30T19:26:15Z")

</div>

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:

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

```

```julia
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.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [July 30, 2017, 9:07pm UTC](https://discourse.julialang.org/t/regular-expression-regex-for-updating-to-where-syntax/5141/2 "2017-07-30T21:07:21Z")

</div>

[PSA: Parametric method syntax deprecation about to drop - #15 by ZacLN](https://discourse.julialang.org/t/psa-parametric-method-syntax-deprecation-about-to-drop/4931/15) also has some nice stuff
