Kind of a noob here, apologies if I misstep.
I\'m learning regular expressions and am on this lesson: https://regexone.com/lesson/capturing_groups.
In the
You need the first captured group:
a.group(1)
b.group(1)
...
without any captured group specification as argument to group(), it will show the full match, like what you're getting now.
Here's an example:
In [8]: string_one = 'file_record_transcript.pdf'
In [9]: re.search(r'^(file.*)\.pdf$', string_one).group()
Out[9]: 'file_record_transcript.pdf'
In [10]: re.search(r'^(file.*)\.pdf$', string_one).group(1)
Out[10]: 'file_record_transcript'