Never mind, I figured out it was an escaping issue. This is all fine if you 
do Regex("\\d\\d").


On Monday, February 22, 2016 at 5:27:17 PM UTC-8, John Brock wrote:
>
> regex_from_macro = r"\d\d"
> regex_from_function = Regex("\d\d") 
>
> julia> regex_from_macro("45")
> true 
>
> julia> regex_from_function("45")
> false 
>
> julia> regex_from_macro("5")
> false 
>
> julia> regex_from_function("5") 
> false
>
>
> Why does calling r"\d\d" result in different behavior than Regex("\d\d")? 
> I would have expected the behavior to be identical, but it looks like call 
> with Regex(...) always returns false, while r"..." matches as expected.
>
>
> This is with Julia v0.4.2.
>

Reply via email to