Skip to content

Instantly share code, notes, and snippets.

View meayaz's full-sized avatar
💻
software engineer

Mehmet Ayaz meayaz

💻
software engineer
View GitHub Profile
@eabay
eabay / validate-tr-license-plate.coffee
Last active August 11, 2024 13:15
Türkiye plaka kodu için regular expression
validate = (val) ->
# boşluk karakterlerini kaldıralım
v = val.replace(/\s+/g, '').toUpperCase()
# http://tr.wikipedia.org/wiki/Türkiye_il_plaka_kodları adresindeki bilgi kullanılmıştır.
regex = /// ^
(0[1-9]|[1-7][0-9]|8[01]) # İl kodu
(
([A-Z])(\d{4,5}) # "99 X 9999", "99 X 99999"
| ([A-Z]{2})(\d{3,4}) # "99 XX 999", "99 XX 9999"