title: How to parse a string in order to convert it to nsattributedstring
body: <p>I have a string in the form of </p>
  
  <blockquote>
    <p><code>"@{profile: id1} is going to @{profile: id2}'s party"</code></p>
  </blockquote>
  
  <p>How do I convert it to nsattributedstring</p>
  
  <blockquote>
    <p><code>"**Name1** is going to **Name2**'s party"</code></p>
  </blockquote>
  
  <p>Both <code>id1</code> and <code>id2</code> represent a string.
  You can get <code>Name1</code> by pass <code>id1</code> into a function named <code>getName(by id: String)</code></p>
  
  <p>Given a string </p>
  
  <pre><code>"@{profile: 735bcec0-1470-11e9-8384-a57f51e70e5f} is \
  going to @{profile: 4c0bf620-2022-11e9-99ad-0777e9298bfb} party."
  </code></pre>
  
  <p>Assume </p>
  
  <pre><code>getName(by: "735bcec0-1470-11e9-8384-a57f51e70e5f") -&gt; "Jack"
  getName(by: "4c0bf620-2022-11e9-99ad-0777e9298bfb") -&gt; "Rose"
  
  </code></pre>
  
  <p>I would like to get back a nsattributedstring</p>
  
  <pre><code>"Jack is going to Rose's party"
  </code></pre>
  
  <p>Where both <code>Jack</code> and <code>Rose</code> should be bold.</p>