I’m trying to find a way to make an array of matched patterns out of a string.
I’ll explain myself with an example.
From a string like
Lorem ipsum dolor **sit** amet, consectetur adipiscing elit.
Nulla elementum euismod mi. Morbi eu eros eget augue vestibulum semper.
Curabitur sapien purus, **semper** in consequat eu, gravida vitae purus.
I need to apply a regexp to extract the words sit and semper
and I really don’t know how to manage it.
I would think a regex such as
\*{2}(.*?)\*{2}would take care of it, and using regular expressions in Objective-C (assuming you’re on an Apple platform) you’d want to look at the NSRegularExpression iOS or Mac documentation.