We’ve got a capture-group for the numbers (the () means we’re saving that part for later). Are we planning to do something with the mlg numbers? Why don’t we care about the mmmberry numbers?
The capture is one or more numbers, but then it’s an optional group. Write ([0-9]*) instead
We match mlg and mlg1 but not mlga because we anchor to the end ($). But not on mmmberry–that one will match “mmmberry5” (but we don’t track the number!) but also “mmmberry_is_the_worst” so the enemy of my enemy is also my enemy because they share a prefix
Maybe mlg has sock-puppet accounts mlg1, mlg2, but never MLG?
Who wrote these regex? They are terrible:
()means we’re saving that part for later). Are we planning to do something with the mlg numbers? Why don’t we care about the mmmberry numbers?([0-9]*)insteadmlgandmlg1but notmlgabecause we anchor to the end ($). But not on mmmberry–that one will match “mmmberry5” (but we don’t track the number!) but also “mmmberry_is_the_worst” so the enemy of my enemy is also my enemy because they share a prefixMaybe mlg has sock-puppet accounts mlg1, mlg2, but never MLG?