Get a strep test. If he is potty trained and then has regressions it could be related to strep throat. Odd, I know. Ask for a 72 hour culture along with the rapid test (they can hold both swabs at once so he only has to deal with the discomfort the one time.)
My daughter has a strep-related autoimmune disorder that causes her brain-stem to swell and this was one of the earliest symptoms we saw in her and is very typical of this type of disorder. Catching it early is key. Basically when these kids are "sick:" they show no outward signs like sore throat, but will regress in other ways (baby talk, bed and day wetting) and it comes off looking like they are just in la-la land or misbehaving (or later, ADD)
I urge you to please have him tested. If this is the case then he is not getting the cues when he is sick that he has to potty! A 72 hour culture is the best indicator of whether this is the case. A rapid test will often give you a false negative, which is why you should do both. (IF the rapid comes up positive, then you know sooner and can start the antibiotics sooner.)
I hope this is not the case, but having the history we have, I couldn't stand by and not tell you. If you are interested in more info, I'm happy to help.
M.