c# - Regular expression to find all words which starts with white space and ends with white space -
i need find words in string starting , ending white space. finding issues while searching white spaces. however, achieve below. starts , ends @@
. whitespaces great.
string input = "@@12@@ @@13@@"; foreach (match match in regex.matches(input, @"@@\b\s+?\b@@")) { messagebox.show(match.groups[1].value); }
from msdn doc:
// define regular expression repeated words. regex rx = new regex(@"\b(?<word>\w+)\s+(\k<word>)\b", regexoptions.compiled | regexoptions.ignorecase);
Comments
Post a Comment