Regular Expressions 101

Community Patterns

0

#value # value

Python
account for comments
Submitted by anonymous - 2 years ago
0

OS正则表达式

Java 8
zzx
Submitted by zzx - 2 years ago
0

DB

Java 8
DB
Submitted by DB - 2 years ago
0

matlab代码

Python
matlab代码
Submitted by java - 2 years ago
0

find const string in code for xml/java

Python
.
Submitted by anonymous - 2 years ago
0

IP Address

Java 8
IP Address RegEx
Submitted by anonymous - 2 years ago

Mikrotik firewall logs

2

Regular Expression
Golang

`
^((?P<mode>[^:]+):\s)?in:(?P<InputInterface>[^,]+)\s+out:(?P<OutputInterface>[^,]+),\sconnection-state:(?P<ConnectionState>[^\s]+)\s+(?:src-mac\s+(?P<SourceMacAddress>[^,]+),\s+)?proto\s+(?P<Protocol>\w+)(?:\s+\((?P<Flags>[^)]+)\))?,\s+\[?(?P<SourceAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<SourcePort>\d+))?->\[?(?P<DestinationAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<DestinationPort>\d+))?,\s(NAT\s?\[?(?P<NatSourceAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<NatSourcePort>\d+))?->\(\[?(?P<NatExternalAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<NatExternalPort>\d+))?->\[?(?P<NatInternalAddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-f\d:]+)\]?(?::(?P<NatInternalPort>\d+))?\),\s)?len\s+(?P<Length>\d+)
`
gm

Description

Loading markdown...
Submitted by anonymous - 7 months ago
(Last modified 7 months ago)