# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(?<= --> ).*(?=\D+|\$)"
test_str = ("1\n"
"00:00:07,200 --> 00:00:10,880\n"
"Hi, I'm Jack Shepard\n"
"and I'm a 3D artist for video games.\n\n"
"2\n"
"00:00:12,640 --> 00:00:16,800\n"
"Throughout my career,\n"
"I've done more than nine AAA projects,\n\n"
"3\n"
"00:00:16,800 --> 00:00:18,360\n"
"including \"Metro Exodus,\"\n\n"
"4\n"
"00:00:18,360 --> 00:00:21,720\n"
"\"Call of Duty: WWII\"\n"
"and \"Overkill's The Walking Dead.\"\n\n"
"5\n"
"00:00:21,720 --> 00:00:25,920\n"
"I work as Supervising Environment\n"
"and Prop Artist at elite3D,\n\n"
"6\n"
"00:00:25,920 --> 00:00:27,960\n"
"a video game outsourcing company.\n\n"
"7\n"
"00:00:29,400 --> 00:00:32,720\n"
"From a young age, video games\n"
"were very present in my life,\n\n"
"8\n"
"00:00:32,720 --> 00:00:35,880\n"
"I really enjoyed drawing\n"
"and writing my own stories.\n\n"
"9\n"
"00:00:35,880 --> 00:00:38,240\n"
"I'm passionate about\n"
"all the hidden stories\n\n"
"10\n"
"00:00:38,240 --> 00:00:40,560\n"
"behind the textures\n"
"of the props and assets,\n\n"
"11\n"
"00:00:40,560 --> 00:00:44,560\n"
"the objects used to decorate\n"
"the game's scenes or world.\n\n"
"12\n"
"00:00:44,560 --> 00:00:47,720\n"
"Everything has a story,\n"
"even if it's an inanimate object.\n\n"
"13\n"
"00:00:48,800 --> 00:00:51,280\n"
"In this course,\n"
"you'll find out\n\n"
"14\n"
"00:00:51,280 --> 00:00:54,280\n"
"what creating props and other video game\n"
"objects consists of.\n\n"
"15\n"
"00:00:54,280 --> 00:00:57,560\n"
"Plus, how to make them\n"
"professional quality.\n\n"
"16\n"
"00:00:58,160 --> 00:01:00,080\n"
"As a project, we'll model a prop\n\n"
"17\n"
"00:01:00,080 --> 00:01:02,280\n"
"that could be in any video game.\n\n"
"18\n"
"00:01:03,000 --> 00:01:05,920\n"
"To do this, I'll share\n"
"sources of inspiration with you\n\n"
"19\n"
"00:01:05,920 --> 00:01:07,920\n"
"that marked the beginning of my career.\n\n"
"20\n"
"00:01:07,920 --> 00:01:10,880\n"
"After, we'll learn the phases\n"
"or the pipeline to follow\n\n"
"21\n"
"00:01:10,880 --> 00:01:12,720\n"
"for developing our asset.\n\n"
"22\n"
"00:01:12,720 --> 00:01:16,320\n"
"We'll find out how to configure\n"
"our software and scripts\n\n"
"23\n"
"00:01:16,320 --> 00:01:18,040\n"
"to save time working.\n\n"
"24\n"
"00:01:18,040 --> 00:01:21,000\n"
"We'll also look at\n"
"the importance of having good references\n\n"
"25\n"
"00:01:21,000 --> 00:01:22,600\n"
"before we start modeling.\n\n"
"26\n"
"00:01:23,040 --> 00:01:25,840\n"
"With this knowledge, we'll get typing\n\n"
"27\n"
"00:01:25,840 --> 00:01:27,800\n"
"to start modeling our asset.\n\n"
"28\n"
"00:01:28,600 --> 00:01:32,160\n"
"First we'll do the block out\n"
"to figure out the prop's dimensions\n\n"
"29\n"
"00:01:32,160 --> 00:01:35,080\n"
"and get an idea of the pieces\n"
"that we'll need\n\n"
"30\n"
"00:01:35,080 --> 00:01:37,040\n"
"to estimate how long this will take us.\n\n"
"31\n"
"00:01:37,040 --> 00:01:40,440\n"
"Then, the high poly phase,\n"
"first with the Sub-D elements,\n\n"
"32\n"
"00:01:40,440 --> 00:01:43,600\n"
"with containment and support loops\n"
"in the more complex pieces.\n\n"
"33\n"
"00:01:43,600 --> 00:01:47,200\n"
"Later, with Zbrush, we'll look at\n"
"how to weld high poly pieces\n\n"
"34\n"
"00:01:47,200 --> 00:01:51,040\n"
"and finally, we'll give our asset\n"
"details with floaters and screws.\n\n"
"35\n"
"00:01:51,680 --> 00:01:55,440\n"
"Then, the low phase\n"
"to reduce the poly of our high poly\n\n"
"36\n"
"00:01:55,440 --> 00:01:59,600\n"
"followed by UV mapping\n"
"and bakes to project detail.\n\n"
"37\n"
"00:01:59,960 --> 00:02:03,040\n"
"We'll work with the substance painter\n"
"to texturize,\n\n"
"38\n"
"00:02:03,040 --> 00:02:06,720\n"
"we'll create our base materials\n"
"to give them history and realism.\n\n"
"39\n"
"00:02:07,480 --> 00:02:09,400\n"
"With our finished asset,\n\n"
"40\n"
"00:02:09,400 --> 00:02:12,920\n"
"we'll see the steps to integrate it\n"
"into our game motor.\n\n"
"41\n"
"00:02:12,920 --> 00:02:15,520\n"
"Lastly, we'll illuminate\n"
"our asset in Marmoset\n\n"
"42\n"
"00:02:15,520 --> 00:02:19,840\n"
"and we'll retouch it in Photoshop\n"
"before posting it on social media.\n\n"
"43\n"
"00:02:19,840 --> 00:02:22,120\n"
"After the course,\n"
"you'll have a complete model\n\n"
"44\n"
"00:02:22,120 --> 00:02:24,840\n"
"with realistic textures\n"
"to use in video games.\n\n"
"45\n"
"00:02:26,320 --> 00:02:29,440\n"
"For this course,\n"
"you should have a basic knowledge\n\n"
"46\n"
"00:02:29,440 --> 00:02:32,040\n"
"of hard surface or poly modeling.\n\n"
"47\n"
"00:02:32,040 --> 00:02:36,040\n"
"Plus, familiarity with\n"
"3ds Max would be very helpful,\n\n"
"48\n"
"00:02:36,040 --> 00:02:39,840\n"
"however, if you know a different one,\n"
"you can follow the course's content.\n\n"
"49\n"
"00:02:40,240 --> 00:02:43,600\n"
"You'll need a computer with 3ds Max\n"
"or similar for modeling\n\n"
"50\n"
"00:02:43,600 --> 00:02:47,120\n"
"and Photoshop CS6 or higher\n"
"for final retouches on the object.\n\n"
"51\n"
"00:02:48,000 --> 00:02:49,320\n"
"Create assets from scratch\n\n"
"52\n"
"00:02:49,320 --> 00:02:52,160\n"
"and do modeling projects\n"
"on a professional level.")
matches = re.finditer(regex, test_str, re.MULTILINE)
for matchNum, match in enumerate(matches, start=1):
print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
for groupNum in range(0, len(match.groups())):
groupNum = groupNum + 1
print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html