I am trying to develop some regex to find all words that start with an @:
I thought that \\@\\w+
would do it but this also matches words that have @ con
And what about a non-Regex approach?
C# version:
string input = "word1 word2 @word3 ";
string[] resultWords = input.Split(' ').ToList().Where(x => x.Trim().StartsWith("@")).ToArray();
VB.NET version:
Dim input As String = "word1 word2 @word3 "
Dim resultWords() As String = input.Split(" "c).ToList().Where(Function(x) x.Trim().StartsWith("@")).ToArray