visa = r"^(?:4[0-9]{12}(?:[0-9]{3})?)$";
input = "4457418557635128";

ismatch(visa, input)  #=> true
if ismatch(visa, input)
    println("credit card found")
    m = match(visa, input)
    println(m.match) #=> 4457418557635128
    println(m.captures) #=> nothing
    println(m.offset) #=> 1
    println(m.offsets) #=> []
end

m = match(r"(ju|l)(i)?(a)", "Julia")
println(m.match) #=> "lia"
println(m.captures) #=> l - i - a
println(m.offset) #=> 3
println(m.offsets) #=> 3 - 4 - 5

str = "The sky is blue"
reg = r"[\w]{3,}"
# matchall returns an array with a RegexMatche for each match
r = matchall(reg, str)
show(r) #=> ["The","sky","blue"]
# eachmatch returns an iterator over all the matches
iter = eachmatch(reg, str)
for i in iter
    println("\"$(i.match)\" ")
end
