Regular Expressions 101

Community Patterns

0

回溯

PCRE (PHP <7.3)
no description available
Submitted by anonymous - 4 years ago
0

TNRid

PCRE (PHP <7.3)
^-|\b\d.{0,20}.$
Submitted by anonymous - 4 years ago

extended nginx log format

0

Regular Expression
PCRE (PHP <7.3)

/
(?:-|(?P<real_ip>[\-\da-f.:, ]+)) - (?<remote_user>\S+) \[(?<timestamp>[^\]]+)\]\s+"(?:\-|(?<request>\w+) (?<request_uri>[^ \?]+)(?:\?(?<request_uri_query>[^ ]*))? (?<request_version>[\w\/\.]+))"\s+(?P<status>[1-9]\d{2})\s+(?P<body_bytes_sent>\d+)\s+"(?<http_referer>[^"]+)"\s+"(?<http_user_agent>[^"]+)"\s+"(?P<remote_ip>[\da-f.:]+)" (?:\-|(?P<upstream_response_time>\d+(?:.\d+)?))\s+(?P<request_time>\d+(?:.\d+)?) (?P<pipe>[\.p])
/
gm

Description

Loading markdown...
Submitted by Pei-Tang Huang - a year ago