0

Is there a way in Objective C to extract a part of a Regex found string? The PHP preg_match code would look like this:

 preg_match("/{"id":"([0-9]*)"}/", $input_line, $output_array);

The data looks like this:

'7D16CFCB-2472-4034-B7AB-0A126C01FFC4', '9833496A-2B33-BF50-A37D84E8FB42', STR_TO_DATE('2014-06-17 18:51:47  0000','%Y-%m-%d %T'), STR_TO_DATE('2014-06-19 02:05:57  0000','%Y-%m-%d %T'), 'GMT (GMT) offset 0',0,'09989E6A-74F5-40F7-F0BF:d3e72eo8','Native','Ktel 2663' )[{"id":"184"}]1 record added to events

The result I am looking for is "184" I want to identify the data I am looking for by the characters around it (e.g. id:) but I want only a specific part of the result.. i.e. the number

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274
SchroedingersCat
  • 487
  • 8
  • 21
  • Your PHP code is invalid, the quotes are not right. – Barmar Jun 19 '14 at 04:56
  • possible duplicate of [Regular expressions in an Objective-C Cocoa application](http://stackoverflow.com/questions/422138/regular-expressions-in-an-objective-c-cocoa-application) – Barmar Jun 19 '14 at 04:57
  • 1
    The prior question (from 5 years ago) has outdated answers other than the one that says that Regex is available since IOS 4. I am still looking for an answer about how to properly do that in Obj C today. – SchroedingersCat Jun 19 '14 at 12:35

0 Answers0