İçeriğe geç
uxTools
Geliştirici

Regex Açıklayıcı

Token bazlı ayrıştırma, her token için örnek + tuzak, SVG demiryolu diyagramı, 80-entry desen kütüphanesi (email / URL / IPv4 / UUID / kredi kartı vb.), katastrofik backtracking ve yaygın hatalar için linter, motorlar arası dönüştürücü (JS / PCRE / Python / Java / .NET / Ruby / Go / POSIX).

Desen

Bir regex yaz veya yapıştır. Aşağıdaki flagleri aç/kapat. Vurgulanan görünümde herhangi bir tokenın üzerine gelerek ne yaptığını gör.

//g
Flagler
Örnek yükle:

Token dökümü

Desenin her parçası sırayla, sade Türkçe ile.

(?<year>\d{4})Tür: Named group

Named capturing group "year" (#1). Accessible via match.groups.year.

Eşleşir

  • · Whatever the inner pattern matches

Eşleşmez

  • · Anything that fails the inner pattern
\d{4}Tür: Predefined class

Matches any digit (0–9). Matches the previous element exactly 4 time(s).

Eşleşir

  • · 0
  • · 5
  • · 9
  • · Exactly 4 repetitions

Eşleşmez

  • · a
  • · -
  • ·
  • · Fewer or more than the required count
-Tür: Literal

Literal character — matches the character "-" exactly.

Eşleşir

  • · -

Eşleşmez

  • · Any other character
(?<month>\d{2})Tür: Named group

Named capturing group "month" (#2). Accessible via match.groups.month.

Eşleşir

  • · Whatever the inner pattern matches

Eşleşmez

  • · Anything that fails the inner pattern
\d{2}Tür: Predefined class

Matches any digit (0–9). Matches the previous element exactly 2 time(s).

Eşleşir

  • · 0
  • · 5
  • · 9
  • · Exactly 2 repetitions

Eşleşmez

  • · a
  • · -
  • ·
  • · Fewer or more than the required count
-Tür: Literal

Literal character — matches the character "-" exactly.

Eşleşir

  • · -

Eşleşmez

  • · Any other character
(?<day>\d{2})Tür: Named group

Named capturing group "day" (#3). Accessible via match.groups.day.

Eşleşir

  • · Whatever the inner pattern matches

Eşleşmez

  • · Anything that fails the inner pattern
\d{2}Tür: Predefined class

Matches any digit (0–9). Matches the previous element exactly 2 time(s).

Eşleşir

  • · 0
  • · 5
  • · 9
  • · Exactly 2 repetitions

Eşleşmez

  • · a
  • · -
  • ·
  • · Fewer or more than the required count

Demiryolu diyagramı

Desenin görsel haritası. Bir segmente tıklayarak ilgili karta atla.

Named capturing group "year" (#1). Accessible via match.groups.year.(?<year>\d{…Literal character — matches the character "-" exactly.-Named capturing group "month" (#2). Accessible via match.groups.month.(?<month>\d…Literal character — matches the character "-" exactly.-Named capturing group "day" (#3). Accessible via match.groups.day.(?<day>\d{2…

Token türüne göre renklendirildi

Tespit edilen özellikler

Desenin kullandıklarına dair üst düzey özet.

Yakalama grupları3
Adlandırılmış gruplaryear, month, day
Geri referanslarYok
Lookaround'lar0
Quantifier'lar{4} {2}
Karakter sınıfları3
Anchor'lar0
Kullanılan flaglerg

Linter

Yaygın regex hatalarını ve tuzaklarını yakalayan sezgisel kontroller.

Temiz görünüyor — uyarı yok.

Optimize et / sadeleştir

Deseni daha kısa, hızlı veya okunur yapmak için öneriler.

Convert unreferenced (...) groups to non-capturing (?:...) for clarity.

Metin üzerinde test

Örnek metin yapıştır. Eşleşmeler yakalama renkleriyle vurgulanır.

$1, $2, $<ad> kullan. Boş bırakırsan değiştirme uygulanmaz.

Önizleme

Release 02/05/2026
Patch 15/06/2026
Kickoff 22/07/2026

3 eşleşme

Release 2026-05-02 Patch 2026-06-15 Kickoff 2026-07-22
2026-05-02Konum: 818
Gruplar:$1=2026$2=05$3=02
Adlandırılmış:year=2026month=05day=02
2026-06-15Konum: 2535
Gruplar:$1=2026$2=06$3=15
Adlandırılmış:year=2026month=06day=15
2026-07-22Konum: 4454
Gruplar:$1=2026$2=07$3=22
Adlandırılmış:year=2026month=07day=22

Desen kütüphanesi

Seçilmiş desenler — açıklayıcıya yüklemek için tıkla.

Validation

  • Email (RFC-lite)

    ^[^\s@]+@[^\s@]+\.[^\s@]+$

  • URL (http/https)

    ^https?:\/\/[^\s/$.?#].[^\s]*$

  • URL (any scheme)

    ^[a-z][a-z0-9+.-]*:\/\/\S+$

  • IPv4

    ^(?:25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)){3}$

  • IPv6

    ^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$

  • UUID v4

    ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

  • UUID (any version)

    ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

  • ISBN-10

    ^(?:\d[\ |-]?){9}[\dXx]$

  • ISBN-13

    ^97[89][\ |-]?(?:\d[\ |-]?){9}\d$

  • Credit card (Luhn-shaped)

    ^(?:\d[ -]?){13,19}$

  • Visa

    ^4\d{12}(?:\d{3})?$

  • Mastercard

    ^(?:5[1-5]\d{2}|222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$

  • American Express

    ^3[47]\d{13}$

  • Phone (E.164)

    ^\+[1-9]\d{1,14}$

  • Phone (US)

    ^(?:\+?1[\s.-]?)?\(?[2-9]\d{2}\)?[\s.-]?\d{3}[\s.-]?\d{4}$

  • Hex color

    ^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$

  • Date ISO 8601

    ^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$

  • Date US

    ^(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12]\d|3[01])\/\d{4}$

  • Date EU

    ^(?:0[1-9]|[12]\d|3[01])\.(?:0[1-9]|1[0-2])\.\d{4}$

  • Time (24h HH:MM)

    ^(?:[01]\d|2[0-3]):[0-5]\d$

  • Time (HH:MM:SS)

    ^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$

  • Postal code (US ZIP)

    ^\d{5}(?:-\d{4})?$

  • Postal code (UK)

    ^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$

  • Postal code (CA)

    ^[ABCEGHJ-NPRSTVXY]\d[A-Z] ?\d[A-Z]\d$

  • MAC address

    ^(?:[0-9A-F]{2}[:-]){5}[0-9A-F]{2}$

  • Slug

    ^[a-z0-9]+(?:-[a-z0-9]+)*$

  • Strong password

    ^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$

  • Username (3-20 alnum + _)

    ^[A-Za-z0-9_]{3,20}$

Web

  • URL parts (named)

    ^(?<scheme>https?):\/\/(?<host>[^\/?#]+)(?<path>\/[^?#]*)?(?:\?(?<query>[^#]*))?(?:#(?<hash>.*))?$

  • Query string param

    [?&]([^=&]+)=([^&]*)

  • Anchor links

    #[A-Za-z0-9-_]+

  • Domain (no scheme)

    ^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$

  • Subdomain

    ^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.){2,}[a-z]{2,}$

HTML/Markdown

  • HTML tag

    <\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s[^>]*)?>

  • HTML attribute

    ([a-zA-Z-]+)\s*=\s*"([^"]*)"

  • Markdown heading

    ^(#{1,6})\s+(.+)$

  • Markdown link

    \[([^\]]+)\]\(([^)]+)\)

  • Markdown image

    !\[([^\]]*)\]\(([^)]+)\)

  • HTML comment

    <!--[\s\S]*?-->

Programming

  • Identifier (C-style)

    ^[A-Za-z_][A-Za-z0-9_]*$

  • Function declaration

    function\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*\(

  • Arrow function

    (?:const|let|var)\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*=\s*\(?[^)]*\)?\s*=>

  • Line comment (//)

    \/\/.*$

  • Block comment

    \/\*[\s\S]*?\*\/

  • Double-quoted string

    "(?:[^"\\]|\\.)*"

  • Single-quoted string

    '(?:[^'\\]|\\.)*'

  • Import statement

    ^import\s+(?:[^"';]+\s+from\s+)?["']([^"']+)["'];?$

  • TODO marker

    \b(?:TODO|FIXME|HACK|XXX|NOTE)\b:?\s*(.*)$

Data

  • CSV row

    (?:^|,)("(?:[^"]|"")*"|[^",]*)

  • JSON value (rough)

    "(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null

  • key=value pair

    ([A-Za-z_][A-Za-z0-9_]*)=([^\s]+)

  • Semantic version

    ^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+([0-9A-Za-z.-]+))?$

  • Base64

    ^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$

  • Number with separators

    ^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?$

  • Money amount

    ^[$€£¥]?\s?\d{1,3}(?:[,.]\d{3})*(?:[,.]\d{2})?$

Discord/Roblox

  • Discord ID (snowflake)

    ^\d{17,20}$

  • Discord mention

    <@!?(\d{17,20})>

  • Discord channel link

    <#(\d{17,20})>

  • Discord role mention

    <@&(\d{17,20})>

  • Discord custom emoji

    <a?:(\w+):(\d{17,20})>

  • Roblox username

    ^(?!.*__)[A-Za-z][A-Za-z0-9_]{2,19}$

  • Minecraft username

    ^[A-Za-z0-9_]{3,16}$

  • Minecraft UUID

    ^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$

Whitespace

  • Leading whitespace

    ^\s+

  • Trailing whitespace

    \s+$

  • Blank line

    ^\s*$

  • Multiple spaces

    +

  • Windows line ending

    \r\n

Misc

  • Emoji (rough)

    [\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}]

  • Roman numeral

    ^M{0,3}(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3})$

  • GitHub @mention

    @([A-Za-z0-9](?:[A-Za-z0-9-]{0,38}))

  • Hex bytes

    \b[0-9a-fA-F]{2}\b

  • MongoDB ObjectId

    ^[0-9a-f]{24}$

  • JWT

    ^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$

  • Hash (SHA-256 hex)

    ^[a-f0-9]{64}$

  • Hash (MD5 hex)

    ^[a-f0-9]{32}$

  • Twitter handle

    @([A-Za-z0-9_]{1,15})

  • Hashtag

    #([\p{L}\p{N}_]+)

  • Latitude/longitude

    ^(-?\d{1,2}(?:\.\d+)?),\s*(-?\d{1,3}(?:\.\d+)?)$

Diğer motor notları

Desenin başka regex motorlarına nasıl çevrildiği ve farkları.