Skip to content

Instantly share code, notes, and snippets.

@eabay
Last active April 14, 2023 15:15
Show Gist options
  • Save eabay/00ea8454f625bf50286b to your computer and use it in GitHub Desktop.
Save eabay/00ea8454f625bf50286b to your computer and use it in GitHub Desktop.
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"
| ([A-Z]{3})(\d{2}) # "99 XXX 99"
)
$ ///
v.match(regex)?
@dousoftware
Copy link

Flutter için kullanımı nedir?

@BurakDurmus
Copy link

Dart için;
RegExp(r'^(0[1-9]|[1-7][0-9]|8[01])((\s?[a-zA-Z]\s?)(\d{4,5})|(\s?[a-zA-Z]{2}\s?)(\d{3,4})|(\s?[a-zA-Z]{3}\s?)(\d{2,3}))$')

@mrkync
Copy link

mrkync commented Dec 19, 2022

C# için harf ve rakamlar arasında birer boşluk olacak şekilde nasıl yapabiliriz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment