Skip to content

Instantly share code, notes, and snippets.

@mertcangokgoz
Created January 23, 2019 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mertcangokgoz/bd2d31f9cad259752fc8a5fe623ee1e2 to your computer and use it in GitHub Desktop.
Save mertcangokgoz/bd2d31f9cad259752fc8a5fe623ee1e2 to your computer and use it in GitHub Desktop.
Telefon Numarası Regex // Phone Number
@"^(0[1-9](\d{2}) (\d{3}) (\d{2}) (\d{2}))$
Mail Adresi Regex //E-Mail Adress
@"^\w+[\w-\.]*\@\w+((-\w+)|(\w*))\.[a-z]{2,3}$"
Tarih Formatı Regex //Date
@"(((0[1-9]|[12][0-9]|3[01])([/])(0[13578]|10|12)([/])([1-2][0,9][0-9][0-9]))|(([0][1-9]|[12][0-9]|30)([/])(0[469]|11)([/])([1-2][0,9][0-9][0-9]))|((0[1-9]|1[0-9]|2[0-8])([/])(02)([/])([1-2][0,9][0-9][0-9]))|((29)(\.|-|\/)(02)([/])([02468][048]00))|((29)([/])(02)([/])([13579][26]00))|((29)([/])(02)([/])([0-9][0-9][0][48]))|((29)([/])(02)([/])([0-9][0-9][2468][048]))|((29)([/])(02)([/])([0-9][0-9][13579][26])))")
Sadece Rakam Girişine İzin Veren Regex // Only Number
"[0-9]+$"
Sadece Harf Girişine İzin Veren Regex // Only Char
"[A-Za-z]+$"
Sadece Harf ve Rakam Girişine İzin Veren Regex // Only Number And Char
"[A-Za-z0-9]+$"
32-Bit Renkler // 32-Bit Colors
"(?:#|0x)?(?:[0-9A-F]{2}){3,4}"
URL Karşılaştırma // URL Matching
"((https?|ftp)://)?(([^:\n\r]+):([^@\n\r]+)@)?((www\.)?([^/\n\r]+))/?([^?\n\r]+)?\??([^#\n\r]*)?#?([^\n\r]*)"
İp Adresi // IP Adress
"\b(?:(?:2(?:[0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9])\.){3}(?:(?:2([0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9]))\b"
HTML Tag Temizleme // Clear HTML Tags
"(<script(\s|\S)*?<\/script>)|(<style(\s|\S)*?<\/style>)|(<!--(\s|\S)*?-->)|(<\/?(\s|\S)*?>)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment