• Do you really expect PAON part of an address to be changed over time?

    Because I cannot see any other reason for not saving PAON and SAON parts once they are found.

    Actually, I cannot see any reason for saving the whole address as a single string.

    You can always get it by concatenating SAON and PAON parts.

    Not so easy for the opposite transformation, as you already know.

    Ideally, different parts of addresses must be separated on entry form, but if it's not done then you better split the address string into parts on saving it in the database.

    Newly recorded addresses may be bound for manual verification, and correction if needed.

    Saved and verified split would overwrite whatever fuzzy and probably not perfect logic you put in your function.

    Having PAON parts saved could also help identifying the correct way of splitting of new addresses.

    _____________
    Code for TallyGenerator