Regular Expressions 101

Sponsors

Library entries

0
java

lat cyr letters

only lat and cyr letters
Submitted by anonymous - 2 months ago
0
java

LinkedIn Profile Url

LinkedIn Profile Url
Submitted by Morons - 2 months ago
0
python

Meh

d
Submitted by anonymous - 2 months ago
0
python

scrape pdf

get data from pdf
Submitted by anonymous - 2 months ago
0
python

MAC Address

Simple MAC address match/parsing expression
Submitted by cwichel - 2 months ago
0
python

TCN Match

Extract info about STP TCNs
Submitted by anonymous - 2 months ago
0
python

Procurar por IPv4

Match em um IPv4 válido
Submitted by anonymous - 2 months ago
0
python

提取js中的内容

获取变量值等
Submitted by anonymous - 2 months ago

Mikrotik Regex Firewall Log Golang

Vote

0

Regular Expression
golang

`
^.+>[\d]\s(?P<Date>\d{4}-\d{2}-\d{2})T(?P<Time>\d{2}:\d{2}:\d{2}).+firewall,info\s(?P<RadUser>\d+).+in:(?P<InputInterface>[^,]+)\s+out:(?P<OutputInterface>[^,]+),\s+(?:src-mac\s+(?P<SourceMacAddress>[^,]+),\s+)?proto\s+(?P<Protocol>\w+)(?:\s+\((?P<Flags>[^)]+)\))?,\s+\[?(?P<SrcIP>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<SrcPort>\d+))?->\[?(?P<DstIP>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<DstPort>\d+))?,\s(?P<NAT>\w+)\s\((?P<SrcIpLocalNat>\b(?:\d{1,3}\.){3}\d{1,3}\b):(?P<SrcPortLocalNat>\d+)->(?P<SrcIpPublicNat>\b(?:\d{1,3}\.){3}\d{1,3}\b):(?P<SrcPortPublicNat>\d+)\)->(?P<DestIpNat>\b(?:\d{1,3}\.){3}\d{1,3}\b):(?P<DestPortNat>\d+),.+
`

Description

Loading markdown...
Submitted by Vitor Abbade - 3 months ago