There are several ways to solve this using an XPath 1.0 expression.
If you want to always extract the last 3 characters, you can use a combination of the substring() and string-length() functions in XPath. It would look something like this:
A more flexible approach might be to use the substring-after() XPath 1.0 function to extract all the values before the last newline character. Since the address contains line feeds, this will help determine when the address should move to a new line, ensuring the correct format. This method isn’t limited to just 3 characters; it could work with any number of characters and will still function correctly.