Regular Expressions 101

Sponsors

Library entries

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
0
python

SAFE Parsing

Parsing data in SAFE text file
Submitted by anonymous - 2 months ago
0
pcre

css class

css class
Submitted by anonymous - 2 months ago
0
pcre

SC23

SC23
Submitted by 00 - 2 months ago
0
python

Email id extraction

extracting email id from given string
Submitted by anonymous - 2 months ago
1
pcre

Polynom

Regex to get polynomial coefficients
Submitted by Balandin Igor - 2 months ago
0
python

lua_pattern

lua file name
Submitted by anonymous - 2 months ago
0
golang

匹配邮箱

[A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+) `
Submitted by Lintao - 3 months ago

Find next valid markup element of XML content

Vote

0

Regular Expression
pcre

/
(?P<Element><(?P<TagName>[:_A-z][-.0-9:_A-z\xB7]*)(?:[\x09\x0A\x0D\x20]+[:_A-z][-.0-9:_A-z\xB7]*[\x09\x0A\x0D\x20]*=[\x09\x0A\x0D\x20]*(?:"(?:[^<&"]|&(?:[:_A-z][-.0-9:_A-z\xB7]*|#(?:[0-9]+|x[0-9a-fA-F]+));)*"|'(?:[^<&']|&(?:[:_A-z][-.0-9:_A-z\xB7]*|#(?:[0-9]+|x[0-9a-fA-F]+));)*'))*[\x09\x0A\x0D\x20]*(?:>(?:(?:[^<&\]]|](?!]>))*(?:(?:(?P>Element)|&(?:[:_A-z][-.0-9:_A-z\xB7]*|#(?:[0-9]+|x[0-9a-fA-F]+));|<!\[CDATA\[(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x5D]|](?!]>))*]]>|<\?[:_A-z][-.0-9:_A-z\xB7]*(?<!(?i:\?xml))(?:[\x09\x0A\x0D\x20]+(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x3F]|\?(?!>))*)?\?>|<!--(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x2D]|-(?!-))*-->)(?:[^<&\]]|](?!]>))*)*)<\/(?P=TagName)[\x09\x0A\x0D\x20]*|\/)>)|&(?:[:_A-z][-.0-9:_A-z\xB7]*|#(?:[0-9]+|x[0-9a-fA-F]+));|<!\[CDATA\[(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x5D]|](?!]>))*]]>|<\?[:_A-z][-.0-9:_A-z\xB7]*(?<!(?i:\?xml))(?:[\x09\x0A\x0D\x20]+(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x3F]|\?(?!>))*)?\?>|<!--(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x2D]|-(?!-))*-->|<!DOCTYPE[\x09\x0A\x0D\x20]+[:_A-z][-.0-9:_A-z\xB7]*(?:[\x09\x0A\x0D\x20]+(?:SYSTEM[\x09\x0A\x0D\x20]+(?:"[^"]*"|'[^']*')|PUBLIC[\x09\x0A\x0D\x20]+(?:"[\x0A\x0D\x20\x21\x23-\x25\x27-\x2F\x3A\x3B\x3D\x3F\x40_0-9A-z]*"|'[\x0A\x0D\x20\x21\x23-\x25\x28-\x2F\x3A\x3B\x3D\x3F\x40_0-9A-z]*')[\x09\x0A\x0D\x20]+(?:"[^"]*"|'[^']*')))?[\x09\x0A\x0D\x20]*(?:\[(?:(?:<!ELEMENT[\x09\x0A\x0D\x20]+[:_A-z][-.0-9:_A-z\xB7]*[\x09\x0A\x0D\x20]+(?:EMPTY|ANY|\([\x09\x0A\x0D\x20]*#PCDATA(?:(?:[\x09\x0A\x0D\x20]*\|[\x09\x0A\x0D\x20]*[:_A-z][-.0-9:_A-z\xB7]*)*[\x09\x0A\x0D\x20]*\)\*|[\x09\x0A\x0D\x20]*\))|(?:(?P<choice>\([\x09\x0A\x0D\x20]*(?:[:_A-z][-.0-9:_A-z\xB7]*|(?P>choice)|(?P>seq))[?*+]?(?:[\x09\x0A\x0D\x20]*\|[\x09\x0A\x0D\x20]*(?:[:_A-z][-.0-9:_A-z\xB7]*|(?P>choice)|(?P>seq))[?*+]?)+[\x09\x0A\x0D\x20]*\))|(?P<seq>\([\x09\x0A\x0D\x20]*(?:[:_A-z][-.0-9:_A-z\xB7]*|(?P>choice)|(?P>seq))[?*+]?(?:[\x09\x0A\x0D\x20]*,[\x09\x0A\x0D\x20]*(?:[:_A-z][-.0-9:_A-z\xB7]*|(?P>choice)|(?P>seq))[?*+]?)*[\x09\x0A\x0D\x20]*\)))[?*+]?)[\x09\x0A\x0D\x20]*>|<!ATTLIST[\x09\x0A\x0D\x20]+[:_A-z][-.0-9:_A-z\xB7]*(?:[\x09\x0A\x0D\x20]+[:_A-z][-.0-9:_A-z\xB7]*[\x09\x0A\x0D\x20]+(?:CDATA|(?:ID(?:REFS?)?|ENTIT(?:Y|IES)|NMTOKENS?)|(?:NOTATION[\x09\x0A\x0D\x20]+\([\x09\x0A\x0D\x20]*[:_A-z][-.0-9:_A-z\xB7]*(?:[\x09\x0A\x0D\x20]*\|[\x09\x0A\x0D\x20]*[:_A-z][-.0-9:_A-z\xB7]*)*[\x09\x0A\x0D\x20]*\)|\([\x09\x0A\x0D\x20]*(?:[-.0-9:_A-z\xB7])+(?:[\x09\x0A\x0D\x20]*\|[\x09\x0A\x0D\x20]*(?:[-.0-9:_A-z\xB7])+)*[\x09\x0A\x0D\x20]*\)))[\x09\x0A\x0D\x20]+(?:#(?:REQUIRED|IMPLIED)|(?:#FIXED[\x09\x0A\x0D\x20]+)?(?:"(?:[^<&"]|&(?:[:_A-z][-.0-9:_A-z\xB7]*|#(?:[0-9]+|x[0-9a-fA-F]+));)*"|'(?:[^<&']|&(?:[:_A-z][-.0-9:_A-z\xB7]*|#(?:[0-9]+|x[0-9a-fA-F]+));)*')))*[\x09\x0A\x0D\x20]*>|(?:<!ENTITY[\x09\x0A\x0D\x20]+[:_A-z][-.0-9:_A-z\xB7]*[\x09\x0A\x0D\x20]+(?:(?:"(?:[^%&"]|%[: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D\x20]+[:_A-z][-.0-9:_A-z\xB7]*[\x09\x0A\x0D\x20]+(?:(?:SYSTEM[\x09\x0A\x0D\x20]+(?:"[^"]*"|'[^']*')|PUBLIC[\x09\x0A\x0D\x20]+(?:"[\x0A\x0D\x20\x21\x23-\x25\x27-\x2F\x3A\x3B\x3D\x3F\x40_0-9A-z]*"|'[\x0A\x0D\x20\x21\x23-\x25\x28-\x2F\x3A\x3B\x3D\x3F\x40_0-9A-z]*')[\x09\x0A\x0D\x20]+(?:"[^"]*"|'[^']*'))|PUBLIC[\x09\x0A\x0D\x20]+(?:"[\x0A\x0D\x20\x21\x23-\x25\x27-\x2F\x3A\x3B\x3D\x3F\x40_0-9A-z]*"|'[\x0A\x0D\x20\x21\x23-\x25\x28-\x2F\x3A\x3B\x3D\x3F\x40_0-9A-z]*'))[\x09\x0A\x0D\x20]*>|<\?[:_A-z][-.0-9:_A-z\xB7]*(?<!(?i:\?xml))(?:[\x09\x0A\x0D\x20]+(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x3F]|\?(?!>))*)?\?>|<!--(?:[^\x01-\x08\x0B\x0C\x0E-\x1F\x2D]|-(?!-))*-->)|(?:%[:_A-z][-.0-9:_A-z\xB7]*;|[\x09\x0A\x0D\x20]+))*][\x09\x0A\x0D\x20]*)?>
/
gm

Description

Loading markdown...
Submitted by GyRos - 4 months ago