Uk Post Code Regex -
possible duplicates regex validate uk post codes
i need regex syntax accepts posts codes following formates
cr03jp cr03jp cr0 3jp cr0 3jp
what have
^([a-pr-uwyz0-9][a-hk-y0-9][aehmnprtvxy0-9]?[abehmnprvwxy0-9]? {1,2}[0-9][abd-hjln-uw-z]{2}|gir 0aa)$
which accepts cr0 3jp
rejects cro3jp cr03jp
i have tried following also
/((gir 0aa)|((([a-pr-uwyz][0-9][0-9]?)|(([a-pr-uwyz][a-hk-y][0-9][0-9]?)|(([a-pr-uwyz][0-9][a-hjkstuw])|([a-pr-uwyz][a-hk-y][0-9][abehmnprvwxy])))) [0-9][abd-hjlnp-uw-z]{2}))/i
if has been answered please point me link
use regex
^ ?(([beglmnswbeglmnsw][0-9][0-9]?)|(([a-pr-uwyza-pr-uwyz][a-hk-ya-hk-y][0-9][0-9]?)|(([enwenw][0-9][a-hjkstuwa-hjkstuw])|([enwenw][a-hk-ya-hk-y][0-9][abehmnprvwxyabehmnprvwxy])))) ?[0-9][abd-hjlnp-uw-zabd-hjlnp-uw-z]{2}$
Comments
Post a Comment