The Regex Quantifier Betrayal
Description
A very tight dark-theme code screenshot shows syntax-highlighted Python-like regex code, including a visible fragment resembling `re.findall('index":"(\d*)_(\d*)"', ...)` and a following line converting captured groups with `int(lGroup[0][0])` and another `int(...)` call. The key visible pattern uses `\d*`, which means zero or more digits, rather than `\d+`, which would require at least one digit. The sibling caption says, "The Look your regex gives you when you use asterisks instead of plus," framing the crop as a classic regular-expression footgun. The technical humor is that one quantifier character can silently admit empty captures and push the failure downstream into parsing or type conversion.
Comments
18Comment deleted
The gap between `\d*` and `\d+` is exactly one character wide and somehow still large enough to fit an outage.
parsing json with regex why Comment deleted
Лан Comment deleted
Лан Comment deleted
Лан Comment deleted
Лан Comment deleted
coz can и лан Comment deleted
Лан Comment deleted
Лан Comment deleted
Лан Comment deleted
Лан Comment deleted
Лан Comment deleted
Лан Comment deleted
validating is not parsing Comment deleted
regex in the pic won't match "index":\n"245_445" which is a totally valid json Comment deleted
👍 Comment deleted
"asterisks"... "plus"... why not call them what they are, which is "zero or more occurrences " and "one or more occurrences " Comment deleted
B/c this is easy? Comment deleted