Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2021-07-28 09:15
Flavor·ECMAScript (JavaScript)

/
(?<ch>[a-z])\1*
/
mg
Open regex in editor

Description

Regex to match consecutive identical characters. Then replace each match with <character><no of occurrence> Eg: "Hello" will yield "H1e1l2o1"

Submitted by Chief A