To find out how to do this manually, you can simply break it this way (this is a task that will surely help you in the future):
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
The first part is to know how a regular expression is usually written, so in this case it will be:
var variableName = /stuff/g; ^ ^ ^^ delimiters/---+--/| | | regex / \global modifier, can also have a case modifier
So, drop the modifier and the beginning and the end and evaluate only the regular expression:
((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)
Still gobbledygook, but go ahead: the regex is for capturing content, and we know that unescaped (which means they use backslashes before the character that was escaped \ ) the brackets capture the curly braces, add some new lines around each parenthesis (for research purposes only !!!), and pipes mean "or"
( (?: \( (?: \( [^()]+ \) | [^()]+ )+ \) | \[ (?: \[[^\[\]]*\] | ['"][^'"]*['"] | [^\[\]'"]+ )+ \] | \\. | [^ >+~, ( \[\\]+)+ | [>+~] ) (\s*,\s*)? ( (?: . | \r | \n )* )
The braces mean โselectively match what's inside it like any value from a selection set,โ and so now I'm going to add a few comments and give you the opportunity to work out the rest (also, it looks like some parsers are missing)
( (?: