Regular Expressions 101

Community Patterns

Simple ES5 to ES6 Shorthand Function notation

0

Regular Expression
PCRE (PHP <7.3)

/
function(\s*)\(((\S+,* *)*)\)(\s*){
/
g

Description

Converts standard function(a,b) function notation into (a, b) => { shorthand for ES6.

Submitted by Simon Poole - 7 years ago