Regular Expressions 101

Community Patterns

1...34567...758

groupping math every 2 comma separator

1

Regular Expression
PCRE (PHP <7.3)

/
(([^,]*,){2})
/
gm

Description

i have paste \n after every 2-th comma using sed

sed 's/\(\([^,]*,\)\{2\}\)/\1\n/g'

Submitted by sanekmihailow - 7 months ago