The reason for this is that parcel services sometimes have agreements with USPS to hand off last-mile delivery to USPS. Which means USPS is stuck trying to figure out how to deliver a package to an address they don't serve.
Adding the PO Box number as an apartment number gets them over this hump. Needless to say, it causes absolute havoc with address validation. All of the humans locally involved in delivery know what's up and it all just works, but getting an address following this convention past the computers can be a special kind of hell.
It also turns out that at least one validation service thinks our street address is in a different zip code than it actually is. Having to fudge the address with merchants using such validation services sometimes ends with a trip to the wrong post office and profuse apologies while they rummage through the back looking for a package that's genuinely misaddressed, but wouldn't have been shipped otherwise.
Please, please give your users an escape hatch to use the address as entered, even if it doesn't validate.
314 Something Rd / PO 404
Town, City 12345
This works because the postal service tries to deliver to the last thing on the label that they recognize. Using slash as a separator works better than a comma or newline because it's less likely the service you're shipping from will "notice" that you put a PO box in and force the package to send via USPS.
Don't write a regex, don't try to check if _you_ think it is valid. If you need it to be valid, (e)mail them something at that address and get a verification code back.
The amount of times I've been told 1/2 addresses aren't valid (technically, in the US, an address can be any fraction [0]), any address over 30 characters, domains that have tlds longer than 3 characters, domains that have tlds shorter than 3 characters, domains that aren't gmail.com, on and on and on.
Just stop. Stop trying to fit user-entered content into your tiny conception of what is "valid". Your user knows better than you and there is zero chance you'll write or should write a mega regex to determine validity.
[0]: https://pe.usps.com/text/pub28/28ape_004.htm