Regex ^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$ doesn't seem valid for all french postal codes and even wrong :

  • there is no letter in the code itself, even for Corsica which codes begin with 20 and not 2A or 2B
  • if the french country prefix is used, then values FR and FRA should also be authorized, followed by one space or one minus character

A regex proposal :
^(?:(?:F|FR|FRA)(?:-| ))?\d{5}$