# What is the correct way to regex route parameters in Genie.jl?

**URL:** <https://discourse.julialang.org/t/what-is-the-correct-way-to-regex-route-parameters-in-genie-jl/68064>\
**Category:** Web Stack\
**Tags:** question, regex, genie\
**Created:** [September 12, 2021, 11:22pm UTC](https://discourse.julialang.org/t/what-is-the-correct-way-to-regex-route-parameters-in-genie-jl/68064 "2021-09-12T23:22:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matrsz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matrsz/32/23840_2.png) [@Matrsz](https://discourse.julialang.org/u/Matrsz)\
**Post date:** [September 12, 2021, 11:22pm UTC](https://discourse.julialang.org/t/what-is-the-correct-way-to-regex-route-parameters-in-genie-jl/68064/1 "2021-09-12T23:22:58Z")

</div>

I’m trying to use a regex for one of the fields in a web app’s route. The route requires a lot of dynamic routing. My issue resides in the fact that the regex field is not the last field in my route, and I realized that there is where the problem arises

I am using

```julia
route("/field1/:field2#regex/:field3") do
    ...
end

```

Specifically the regex I’m using if it helps is `.+:[0-9]+` since I need to interpret addresses in the form `host:port`, which gives Genie trouble due to the presence of colon in the route parameter.

I noticed, however, that the router seems to interpet the regex to be `.+:[0-9]+/:field3` as opposed to simply `.+:[0-9]+` with `:field3` as a different dynamic parameter which is what I want.

What would be the correct way to use a dynamic regex field in my route and then continue using dynamic routing? Or, as an alternative solution, is there a different way to tell Genie to accept a dynamic route parameter with a colon in it?

Thanks a lot
