나는C# - 텍스트 콘텐츠를 가져올 Regex 자막 파일 (.srt)?
1
00:00:07,000 --> 00:00:09,000
Time to amaze the world..
create by Hazy
2
00:00:11,000 --> 00:00:12,200
show them
3
00:00:15,000 --> 00:00:16,500
an impossible feat
내가 텍스트 내용을
Time to amaze the world..
create by Hazy,
show them,
an impossible feat
내 정규식 얻을하려는 SRT 파일이 있습니다
string[] souceSrt = Regex.Split(inputText.Text, @"\n*\d+\n\d\d:\d\d:\d\d,\d\d\d --> \d\d:\d\d:\d\d,\d\d\d\n");
을했으나 제대로 동작하지 않습니다. 나는 무엇을해야합니까 ?? 내가 놓친 무언가가 아니라면 RegexHero
string strRegex = @"^.*([a-zA-Z]).*$";
Regex myRegex = new Regex(strRegex, RegexOptions.Multiline);
foreach (Match myMatch in myRegex.Matches(strTargetString))
{
if (myMatch.Success)
{
//grab line
}
}
를 사용
는
정규 표현식을 사용하는 어딘가에 다중 행 플래그를 넣으면 안됩니까? –
'File.ReadAllLines'을 사용하고 Regex를 통해 분할하는 것보다 관심이없는 라인을 건너 뛰는 것이 더 쉽다고 생각합니다. – Tim
일부 사람들이 왜이 게시물을 downvoted 이유를 모르겠다. –