티스토리 뷰

using System.Text.RegularExpressions;
string[] parts = Regex.Split(mytext, "\.\n|\. "); 
# or "\.\s" if you're not picky about it matching tabs, etc.
-------------------

정규식

/\.\s/

.뒤에 공백이 오는 리터럴과 일치합니다 .

-------------------

이를 위해 정규 표현식이 필요하지 않습니다. 오버로드를 사용하면 string.Split문자열 배열이 필요합니다.

string[] splitters = new string[] { ". ", ".\t", "." + Environment.NewLine };
string[] sentences = aText.Split(splitters, StringSplitOptions.None);


출처
https://stackoverflow.com/questions/1904905
댓글
공지사항
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31