5

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?

2 Answers 2

4

The field .match will convert the match object into a string.

mm.match

Sign up to request clarification or add additional context in comments.

Comments

2

You can also use capturing group and index:

julia> mm = match(r"((?<=Info: ).+)", "Info: Kim") RegexMatch("Kim", 1="Kim") julia> mm[1] "Kim" 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.