JuliaLang/julia — pull request #3146 by kmsquire (2013-05-19 05:26:01+00:00)
Title: RFC: Added do-expression syntax for regex matches.

This trivial patch allows one to write regex matches like

```julia
julia> match(r"(.+)@(.+\.[A-Za-z]{2,4})", "julia@julia.org") do id, dom
println("id: $id")
println("domain: $dom")
end
id: julia
domain: julia.org

julia> match(r"(.+)@(.+\.[A-Za-z]{2,4})", "julia_at_julia.org") do id, dom
println("id: $id")
println("domain: $dom")
end

julia>
```

Also adds a short description to the manual.

(Inspired by @StefanKarpinski's match macro comment in #1448.)

Comment: I wanted to write `do (id, dom)`, but julia didn't seem to like that. That would be more readable to me...