Regular Expressions 101

Community Patterns

matches commas not before, after or between digits

1

Regular Expression
PCRE2 (PHP >=7.3)

/
,(?(?=\d)(?<=\D,))
/

Description

this matches all commas except for ones that are next to a digit in some way. change the , or \d or \D according to needs

Submitted by anonymous - 2 years ago