title: Parse large string & replace the parsed string value with new value in iOS 6+
body: <p>In my app I want to follow below steps to get the finalized string. 
  My message format is given below</p>
  
  <pre><code>message &lt;br/&gt;&lt;br/&gt; On {date_time_stamp} sender_name wrote &lt;br/&gt;&lt;br/&gt;
  </code></pre>
  
  <p>Let say my message string is as below</p>
  
  <pre><code> Hello developers &lt;br/&gt;&lt;br/&gt; On {2013-02-28 05:00:33} Bob wrote &lt;br/&gt;&lt;br/&gt;
   Hello World &lt;br/&gt;&lt;br/&gt; On {2013-02-27 08:35:33} Jack wrote &lt;br/&gt;&lt;br/&gt;
   Hello Apple &lt;br/&gt;&lt;br/&gt; On {2013-02-26 04:10:44} Tom wrote &lt;br/&gt;&lt;br/&gt;
  </code></pre>
  
  <p>Now I need to follow below steps</p>
  
  <ol>
  <li><p>Get the all dates in message one by one</p></li>
  <li><p>Convert it from GMT time zone to local time zone</p></li>
  <li><p>Replace GMT dates in message with local date time</p></li>
  <li><p>Finally replace "breakline with \n" &amp; remove curly braces from message.</p></li>
  </ol>
  
  <p>I have the below code</p>
  
  <pre><code> -(void)parseMessageBody:(NSString*)msg
  {
      NSRange openBracket = [msg rangeOfString:@"{"];
      NSRange closeBracket = [msg rangeOfString:@"}"];
      NSRange numberRange = NSMakeRange(openBracket.location + 1, closeBracket.location - openBracket.location - 1);
      NSString *numberString = [msg substringWithRange:numberRange];
      NSLog(@"Parsed string: %@",numberString);
  }
  
  -(NSString*)formattedMessageFromString:(NSString*)msg
  {
      NSString *formattedMessage = @"";
      formattedMessage = [msg stringByReplacingOccurrencesOfString:@"&lt;br/&gt;" withString:@"\n"];
      return formattedMessage;
  }
  
  -(NSString*)getLocalDateFromUTCDateString:(NSString*)utcDateString
  {
      NSDateFormatter *serverDateFormatter = [[NSDateFormatter alloc] init];
      NSTimeZone *sourceTimeZone = [NSTimeZone timeZoneWithName:@"UTC"];
      [serverDateFormatter setTimeZone:sourceTimeZone];
      [serverDateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
      NSDate *dateFromServer = [serverDateFormatter dateFromString:utcDateString];
      DLog(@"UTC date From SERVER: %@",dateFromServer);
  
      NSDateFormatter *localDateFormatter = [[NSDateFormatter alloc] init];
      [localDateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
      NSTimeZone* localTimeZone = [NSTimeZone systemTimeZone];
      [localDateFormatter setTimeZone:localTimeZone];
      NSString *localDate = [localDateFormatter stringFromDate:dateFromServer];
      DLog(@"Converted Local DAte : %@",localDate);
  
      return localDate;
  }
  </code></pre>
  
  <p>I am not able perform steps 1 &amp; 3 to get all the dates in message &amp; replace it with local date time.
  Also message can grow over the time. So parsing needs to be fast. 
  Can anybody tell me how can I get all the dates in message &amp; replace it with converted date ?</p>
  
  <p>Any kind of help is highly appreciated. Thanks in advance.</p>