Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))[, ].{1,}\[([0-3][0-9]\/\w{3}\/[0-9]{4}):([0-2][0-9]:[0-5][0-9]:[0-5][0-9]) ((?:\+|\-)[0-9]{4})\].{1,}"(GET|POST|HEAD|PUT|DELETE|TRACE|CONNECT) ([\/\w\.\-\?\_\=\*\$\%\:]+).{1,}" (\b\d{3}) (\d+|-) "((?:(?:http(?:s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,24}\b[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)|-)" "([^"]+)" "([^"]+)"$
/

Description

Format - cookie_combined Pattern - combined for all groups

Submitted by Samuil Dichev - 9 years ago