@linusben

Регулярные выражения для субтитров, поможете исправить?

Здравствуйте. Помогите пожалуйста разобраться с регулярками.
Я пытаюсь составить две регулярки для субтитров. Первая должна выдергивать таймкод начала предложения, а вторая конец предложения. Замечу, что именно предложение, не строку.
Вот первая, вроде она работает, может у вас будут по ней корректировки.

(?<=\W).*(?=\ --> \d+:\d+:\d+,\d+\s+\b[A-Z].*?\b)

Вторая регулярка для окончания предложения.

(?<=\ -->\ ).*(?=\D+\.|\$)

И вот она странно работает, к примеру в самом первом предложении не выделяется конечный таймкод.
Вот сам пример на котором тестирую.

1
00:00:07,200 --> 00:00:10,880
Hi, I'm Jack Shepard
and I'm a 3D artist for video games.

2
00:00:12,640 --> 00:00:16,800
Throughout my career,
I've done more than nine AAA projects,

3
00:00:16,800 --> 00:00:18,360
including "Metro Exodus,"

4
00:00:18,360 --> 00:00:21,720
"Call of Duty: WWII"
and "Overkill's The Walking Dead."

5
00:00:21,720 --> 00:00:25,920
I work as Supervising Environment
and Prop Artist at elite3D,

6
00:00:25,920 --> 00:00:27,960
a video game outsourcing company.

7
00:00:29,400 --> 00:00:32,720
From a young age, video games
were very present in my life,

8
00:00:32,720 --> 00:00:35,880
I really enjoyed drawing
and writing my own stories.

9
00:00:35,880 --> 00:00:38,240
I'm passionate about
all the hidden stories

10
00:00:38,240 --> 00:00:40,560
behind the textures
of the props and assets,

11
00:00:40,560 --> 00:00:44,560
the objects used to decorate
the game's scenes or world.

12
00:00:44,560 --> 00:00:47,720
Everything has a story,
even if it's an inanimate object.

13
00:00:48,800 --> 00:00:51,280
In this course,
you'll find out

14
00:00:51,280 --> 00:00:54,280
what creating props and other video game
objects consists of.

15
00:00:54,280 --> 00:00:57,560
Plus, how to make them
professional quality.

16
00:00:58,160 --> 00:01:00,080
As a project, we'll model a prop

17
00:01:00,080 --> 00:01:02,280
that could be in any video game.

18
00:01:03,000 --> 00:01:05,920
To do this, I'll share
sources of inspiration with you

19
00:01:05,920 --> 00:01:07,920
that marked the beginning of my career.

20
00:01:07,920 --> 00:01:10,880
After, we'll learn the phases
or the pipeline to follow

21
00:01:10,880 --> 00:01:12,720
for developing our asset.

22
00:01:12,720 --> 00:01:16,320
We'll find out how to configure
our software and scripts

23
00:01:16,320 --> 00:01:18,040
to save time working.

24
00:01:18,040 --> 00:01:21,000
We'll also look at
the importance of having good references

25
00:01:21,000 --> 00:01:22,600
before we start modeling.

26
00:01:23,040 --> 00:01:25,840
With this knowledge, we'll get typing

27
00:01:25,840 --> 00:01:27,800
to start modeling our asset.

28
00:01:28,600 --> 00:01:32,160
First we'll do the block out
to figure out the prop's dimensions

29
00:01:32,160 --> 00:01:35,080
and get an idea of the pieces
that we'll need

30
00:01:35,080 --> 00:01:37,040
to estimate how long this will take us.

31
00:01:37,040 --> 00:01:40,440
Then, the high poly phase,
first with the Sub-D elements,

32
00:01:40,440 --> 00:01:43,600
with containment and support loops
in the more complex pieces.

33
00:01:43,600 --> 00:01:47,200
Later, with Zbrush, we'll look at
how to weld high poly pieces

34
00:01:47,200 --> 00:01:51,040
and finally, we'll give our asset
details with floaters and screws.

35
00:01:51,680 --> 00:01:55,440
Then, the low phase
to reduce the poly of our high poly

36
00:01:55,440 --> 00:01:59,600
followed by UV mapping
and bakes to project detail.

37
00:01:59,960 --> 00:02:03,040
We'll work with the substance painter
to texturize,

38
00:02:03,040 --> 00:02:06,720
we'll create our base materials
to give them history and realism.

39
00:02:07,480 --> 00:02:09,400
With our finished asset,

40
00:02:09,400 --> 00:02:12,920
we'll see the steps to integrate it
into our game motor.

41
00:02:12,920 --> 00:02:15,520
Lastly, we'll illuminate
our asset in Marmoset

42
00:02:15,520 --> 00:02:19,840
and we'll retouch it in Photoshop
before posting it on social media.

43
00:02:19,840 --> 00:02:22,120
After the course,
you'll have a complete model

44
00:02:22,120 --> 00:02:24,840
with realistic textures
to use in video games.

45
00:02:26,320 --> 00:02:29,440
For this course,
you should have a basic knowledge

46
00:02:29,440 --> 00:02:32,040
of hard surface or poly modeling.

47
00:02:32,040 --> 00:02:36,040
Plus, familiarity with
3ds Max would be very helpful,

48
00:02:36,040 --> 00:02:39,840
however, if you know a different one,
you can follow the course's content.

49
00:02:40,240 --> 00:02:43,600
You'll need a computer with 3ds Max
or similar for modeling

50
00:02:43,600 --> 00:02:47,120
and Photoshop CS6 or higher
for final retouches on the object.

51
00:02:48,000 --> 00:02:49,320
Create assets from scratch

52
00:02:49,320 --> 00:02:52,160
and do modeling projects
on a professional level.
  • Вопрос задан
  • 92 просмотра
Пригласить эксперта
Ответы на вопрос 1
Нормально она себя ведет, ты лишний \. добавил

https://regex101.com/r/wXA7Pd/1
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы