This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |