31 Years of Python | 48 Hour Sale Extension!!!
days
hours
minutes
seconds

354-10 Assumes tags have alphanumerics only (no whitespace, "-" or "/")

Screen Link:

My Code:

tag_beg = r"^\["
tag_end = r"\]$"

What I expected to happen:
I went with a fairly simple approach to matching instances in which tags “occur at the [start|end] of a title.”

What actually happened:
My regex matched more titles than expected. By inspecting the returned results, it is clear that the correct answer is not expecting tags that include whitespace, dashes, slashes etc will be counted.

It is true that the more expansive pattern I used has a couple of false hits ( [In a 40 mph crash] ) probably shouldn’t have matched.) But there are literally dozens that looks like legitimate tags to me (e.g. [Osmf-talk], [systemd-devel] [PHP-DEV] ) Others may require some judgement ( [2007?] ) I notice that this help forum allows dashes in tags.

The working definition of “tag” should be clarified for this exercise.

Other Details
To see exactly what was being left out, I used this code:

tag_beg =  r"^\[([^\[^\]]+)\]"
tag_end =   r"\[([^\[^\]]+)\]$"
beginning = titles.str.extract(tag_beg, expand = False)
ending = titles.str.extract(tag_end, expand = False)
endtags = ending.dropna()
begtags = beginning.dropna()
pd.set_option("display.max_rows", None)
endtags.append(begtags).value_counts()
A complete enumeration of all expansive tag matches is under this fold:
“Tag” Count
pdf 274
video 111
2015 3
audio 3
beta 2
slides 2
2014 2
HBR 1
updated 1
Promo Codes in Comments 1
Ubuntu 1
video series 1
comic 1
The Verge 1
videos 1
song 1
Infograph 1
info needed 1
With Infographic 1
FOR GIT USERS 1
XKCD Flowchart 1
Reuters Institute survey 1
Petition 1
viz 1
systemd-devel 1
crash 1
1996 1
Beta 1
SPA 1
from AGPL to Apache 1
Map 1
Excerpt 1
survey 1
2008 1
PHP-DEV 1
ACM Queue 1
repost 1
map 1
video/animation 1
CSS 1
React 1
transcript 1
png 1
Halting Problem 1
detainee 1
In a 40mph Collision 1
Live 1
ask 1
1:47 1
German 1
Will Replace Logstash Forwarder 1
Angular 1
Osmf-talk 1
Google Sheets 1
XSA-148 1
JavaScript 1
47:03 1
Skinnywhale 1
Videos 1
2007? 1
January 2016 1
video, ~15min 1
Android App 1
Challenge 1
Benchmark 1
satire 1
gif 1
dns-operations 1