Regular Expressions 101

Community Patterns

Capture Nth number of instances before a pattern

0

Regular Expression
PCRE (PHP <7.3)

/
^([^,]*,){39}"
/
gm

Description

Elegant way to capture recurring patterns up to a point.

Submitted by anonymous - 7 years ago