I am using RegexKitLite in an iPhone project and want to use regex to find words that start with the @-sign. For instance, "@home @chores", when searched, would return both words.
The regex string I am using is "(?m-s:@.*\\s*)". When I use this, though, I get a crash. When I use the same thing, but with a # instead of @, it works just fine: “(?m-s:#.*\\s*)". WTF?
I would much appreciate it if someone with a better understanding of regular expressions could help me on this. The tutorials I have seen so far have been near incomprehensible to me.
I did a modification of Manu’s idea, just switching the location of the @ in the regex.
I tested it on a string with ‘@foo @bar @baz @lol’ and it seemed to do what you’re looking for in matching on the words and capturing them with the parens.