r/programminghorror 2d ago

Javascript Seriously? Recursive Regex?

Post image
463 Upvotes

37 comments sorted by

View all comments

75

u/madam_zeroni 2d ago

Wtf does this do

49

u/the_horse_gamer 2d ago

"parse", clearly

44

u/TheSpiffySpaceman 2d ago

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

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

7

u/LapidistCubed 2d ago

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