Please see the attached screenshot that looks similar to Notes iOS app. But here in this the user would be typing in the menu in the UITextView
and I want to identify the menu category and have different text color for it. Each menu item would be separated by a single break line. How could I achieve this? Would this be acheivable by using a Regex expression? Any sample code would be very helpful.
The following PCRE-Compitible regex should do the work:
((?<=\n\n)|\A).+
It either matches the first line of your text or a line which follows two newline-characters.