Regular Expressions 101

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
(Alias):\W+([[:print:]]+).+(Email address):\W+([[:print:]]+).+(Starts):\W+([[:print:]]+).+(Expires):\W+([[:print:]]+).+(Reminder):\W+([[:print:]]+).+
/

Description

Given the HTML of an alias's control panel, apply the XPath "//span[@class='maintext']". The second result returned can be parsed by this regex to yield the most pertinent field names and their values.

Submitted by Crumeniferus - 10 years ago