These two regular expressions are equivalent. Both use PHP's flavor of PCRE. (The first one might actually work for other languages PCRE variants as well, I'm not sure.) Neither will work for Javascript--it's pretty impossible to tell, but the first one does still have the conditionals, etc., as the second one. Just, you know, illegibly.
You'll have to horizontal-scroll a decent amount on that first one, too. (And also hope you never, ever, ever need to make changes.)
(?:((?:const)|(?:var))|(?:function))\s+(\w+)(?(1)(?:\s*=\s*(?:(?:function)(?:\s*\w+)?)?)|(?=\s*\())\(([^\)]*)\)(\h*=>\s*)?((?s)\s*\{\s*(?-s))?(?(5)([\s\S]*?)return\s)((?:\V++$\v)?(?:^\h+\V+$\v)*)(?(5)^\};?)
and: