로딩
티스토리 데이터 처리 중입니다.

[C#/General] RegularExpressions : 특정 Char로 시작하는 word 찿기.

 [C#/General] RegularExpressions : 특정 Char로 시작하는 word 찿기.

> special char으로 시작하는 word 검색. string pattern = @"\b[cb]\w+"; c 또는 b 로 시작하는 단어를 찿는 패턴입니다. using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"\b[cb]\w+"; string text = "codekiller is red, blue, test, blabla coding.

"; MatchCollection matches; Regex regex = new Regex(pattern); matches = regex.Matches(text); Console.WriteLine("Pa.....