Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>that should it be :-)</p> <pre><code>NSString * stringToParse = @"{\"query\":{\"normalized\":[{\"from\":\"May_21\",\"to\":\"May 21\"}],\"pages\":{\"19684\":{\"pageid\":19684,\"ns\":0,\"title\":\"May 21\",\"revisions\":[{\"*\":\"==Events==\\n* [[293]] &amp;ndash; Roman Emperors [[Diocletian]] and [[Maximian]] appoint [[Galerius]] as [[Caesar (title)|''Caesar'']] to Diocletian, beginning the period of four rulers known as the [[Tetrarchy]].\\n* [[878]] &amp;ndash; [[Syracuse, Italy]], is [[Muslim conquest of Sicily|captured]] by the ..."; //Replace &amp;ndash with - stringToParse = [stringToParse stringByReplacingOccurrencesOfString:@"&amp;ndash" withString:@"-"]; //[[Caesar (title)|''Caesar'']] Should be Caesar //and [[Maximian]] should be Maximian //same for [[1972]] -&gt; 1972 NSString *regexToReplaceWikiLinks = @"\\[\\[([A-Za-z0-9_ ()]+?\\|)?(\\'\\')?(.+?)(\\'\\')?\\]\\]"; NSError *error = NULL; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regexToReplaceWikiLinks options:NSRegularExpressionCaseInsensitive error:&amp;error]; // attention, the found expression is replacex with the third parenthesis NSString *modifiedString = [regex stringByReplacingMatchesInString:stringToParse options:0 range:NSMakeRange(0, [stringToParse length]) withTemplate:@"$3"]; NSLog(@"%@", modifiedString); </code></pre> <p>results in:</p> <pre><code>{"query":{"normalized":[{"from":"May_21","to":"May 21"}],"pages":{"19684":{"pageid":19684,"ns":0,"title":"May 21","revisions":[{"*":"==Events==\n* 293 -; Roman Emperors Diocletian and Maximian appoint Galerius as Caesar to Diocletian, beginning the period of four rulers known as the Tetrarchy.\n* 878 -; Syracuse, Italy, is captured by the ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload