The first expression deletes any group of spaces that are at least 25 spaces long that are preceded by a |. It also continues deleting anything until it reaches the next |. After the first expression you are left with
'| FIRST LAST NAME| ADDRESS 1
+ Interest Rate
+ 5.450000| CITY STATE ZIPCODE|
+ Total Payment Amount
+$886.00|';
The next expression will remove any set of 25 or 27 or more spaces that are not immediately preceded by a |. It will continue deleting spaces and anything else until it reaches another |. It will delete the spaces after ADDRESS 1, since there are more than 25 of them and keep deleting up to and including 5.450000. Then it will look for another match (/g). There are 25 spaces between CITY and STATE. Those spaces are not immediately preceded by a |. So it will delete those spaces and keep deleting STATE and ZIPCODE until it finds another |. By increasing the 25 to 27, you keep it from matching in this case.