I have to restrict APO FPO address for the City. I have done it by using this regular expression
var regExp : RegExp = new RegExp('^[af][ .]?p[ .]?o|[P|p]*(OST|ost)*\.*\s*[O|o|0]*(ffice|FFICE)*\.*\s*[B|b][O|o|0][X|x]','i');
This works when there is only APO
, FPO
, A.p.o
, F.P.O
etc. pattern, but it still matches when city is APOPKO
which should not happen.
i tried with giving \b
after [af][ .]?p[ .]?o
but din't work for me. Can any one please help on this
Thanks in advance.