Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
\[(\d+\/\d+\/\d+),\s+(\d+:\d+:\d+\s+[a|p]m)\]\s(\w.+):\s(.+)
/
gm

Description

The first group contains the date in format DD/MM/YY The second group contains the time in format HH:MM:SS The third group contains the name of the participant in the conversation The fourth group contains the actual message that the participant sent

Submitted by anonymous - 6 years ago