I tried to do this:
string pattern = @"^\s+"; Regex regex = new Regex(pattern, RegexOptions.Singleline); but when I try to perform
Match match = regex.Match("list command"); returns to me "" .
I tried to do this:
string pattern = @"^\s+"; Regex regex = new Regex(pattern, RegexOptions.Singleline); but when I try to perform
Match match = regex.Match("list command"); returns to me "" .
Most likely, you just confused big and small S
\s is a whitespace character
\S is any character except the space character, you need to write this:
^\S+ or for loyalty:
^\S+\s $ ? - nick_n_a^ and $ are not paired - they can be used separately - mymedia^\S+\s will not work, because I don't need to grab a space along with the word, but ^\S+ seems to work fine. Thank. - 4ezySource: https://ru.stackoverflow.com/questions/630386/
All Articles