Regular Expressions 101

Community Patterns

IMAP Status Response with MESSAGE and UNSEEN count

0

Regular Expression
PCRE (PHP <7.3)

/
\* STATUS (?|(?:\"([^\r\n]+)\")|(\S+)|(?:\{\d+\}\r\n(.*))) \(MESSAGES (\d+) UNSEEN (\d+)\)
/
gi

Description

Matches the folder name (as IMAP ATOM, Quoted String or Literal String) and folder message total and unseen count.

Submitted by Mike Johnson - 10 years ago