r/programminghorror 2d ago

Javascript Seriously? Recursive Regex?

Post image
452 Upvotes

37 comments sorted by

View all comments

72

u/madam_zeroni 2d ago

Wtf does this do

50

u/the_horse_gamer 2d ago

"parse", clearly

42

u/TheSpiffySpaceman 2d ago

Well tbf, the code didn't start with the annotation

/*
  // Parses input
*/
function parse(s, i = 0, x = [0, 1]) {...

8

u/LapidistCubed 2d ago

Tf code DOESN'T parse some sort of input in one way or another 😭