Reputation: 9346
I have a RegexMatch
object which I'd like to convert into a string:
mm = match(r"(?<=Info: ).+", "Info: Kim")
However, I can't figure out how to convert it into a string. The following does not work:
String(mm)
convert(String, mm)
How is this supposed to be accomplished?
Upvotes: 5
Views: 826
Reputation: 2862
You can also use capturing group and index:
julia> mm = match(r"((?<=Info: ).+)", "Info: Kim")
RegexMatch("Kim", 1="Kim")
julia> mm[1]
"Kim"
Upvotes: 2
Reputation: 9346
The field .match
will convert the match
object into a string.
mm.match
Upvotes: 4