PO Box Validation

后端 未结 3 1212
别那么骄傲
别那么骄傲 2021-02-15 16:44

Looking to validate PO Box but wanted to know if such validation existed. I have the Address field split into Address 1 and Address 2 (Where such PO, Apt, Suite info would go)

3条回答
  •  醉梦人生
    2021-02-15 16:52

    Let's go through it...

    /         # Beginning of the regex
    ^         # Beginning of the string
    \s*       # (Any whitespace)
    ((
      P       # Matches your P
      (OST)?  # Matches your ost
      .?      # Matches the space
      \s*     # (Any whitespace)
      O       # Expects an O - you don't have one. Regex failed.
    

提交回复
热议问题