1

如何编写解析 .sub 格式的模式?

字幕格式:{start-frame}{stop-frame}Text (详情:http ://en.wikipedia.org/wiki/MicroDVD )

例子:

{1446}{1493}Roger, transport.|This is Grissom gate control.
{1494}{1521}Please download security codes.
{1522}{1551}Downloading.
{1552}{1622}Transport, I've got two blips|inside your radar signature.
{1622}{1653}They're hiding in your shadow.
{1654}{1686}I don't see anything.
{1808}{1875}This is gate control.|Battle stations.

如何使用 PHP preg_match() 获取以下参数(开始、停止帧和文本)?

4

1 回答 1

3

{([^}]*)}{([^}]*)}([^\r\n]*)

  • 第 1 组:匹配任何内容,直到}
  • 第 2 组:匹配任何内容,直到}
  • 第 3 组:匹配任何内容,直到换行。

你可以在这里看到

于 2013-08-26T16:24:31.887 回答