Regular Expressions 101

Sp⁠onsors

Community Library

Community Library Entry

3

Regular ExpressionOpen Workspace

/
(?<CCT>(?:(?<=[A-Z])(?=[^A-Z]))|(?:(?<=[a-z])(?=[^a-z]))|(?:(?<=\d)(?=\D))|(?:(?<=[^A-Za-z\d])(?=[A-Za-z\d])))
/
g

Description
Created·2018-02-05 18:03
Type·Match
Flavor·PCRE (Legacy)

\b can be replicated as (?<=\w)(?=\W)|(?<=\W)(?=\w)

Understanding how to create these class transitions can be beneficial for several reasons. In this instance, counting the results of this regex can be used to measure randomness within strings containing multiple character classes.

Submitted by @notGeorgePBurdell
Open Workspace