Regular Expressions 101

Community Patterns

1

Get src in img

PCRE (PHP <7.3)
Get src in img
Submitted by Andy - 8 years ago
11

Codice fiscale

PCRE (PHP <7.3)
Check "codice fiscale"
Submitted by Luca - 8 years ago

my apache2 access.log regex

1

Regular Expression
PCRE (PHP <7.3)

/
(?<src_host>\w+\.\w+:\d{2})\s(?<src_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\D{1,6}(?<date_time>[^ ]+)\s(?<GMT_offset>[^ ]+)\]\s"(?<action>(GET|POST|HEAD|TRACE|PUT|DELETE|CONNECT))\s(?<hash_url>[^ ]+)\s(?<protocol>[^\"]+)\"\s(?<code>\d{1,3})\s(?<size>[^ ]+)\s\"(?<referrer>[^ ]+)\"\s\"(?<user_agent>[^ ]+.+)\"
/
g

Description

Loading markdown...
Submitted by marf - 8 years ago