Search code examples
iosobjective-cnsstringnsattributedstringnsregularexpression

Create Regular Expression for specified string in objective c


My NSString like below

@"[o=uid=35=] hghk\u00c2\u00a0 [o=uid=30=] [o=uid=35=] cong."

I need to create regular expression which search numeric values (e.g in first square brackets there is 35 in second there is 30 like this) in between square parenthesis. How could i achieve this task. Is there any alternate way to search numeric values in between square parenthesis? Please help me to short resolve from this. your help would be appreciable.


Solution

  • http://regexpal.com/

    use above link to check the expression

    \b[0-9]+
    

    to find all the integer values

    ([0-9])+
    

    it works.