moving stolen function inline as we use it only for formatgeneral

see regex framework at meta