val line
= "Displaying invoices 1 - 4 of 4 in total" val pattern
= """\d+(?=\s*in total)""".
r println(pattern.findFirstIn(line))
}
b2JqZWN0IE1haW4gZXh0ZW5kcyBBcHAgewoJdmFsIGxpbmUgPSAiRGlzcGxheWluZyBpbnZvaWNlcyAxIC0gNCBvZiA0IGluIHRvdGFsIgoJdmFsIHBhdHRlcm4gPSAiIiJcZCsoPz1ccyppbiB0b3RhbCkiIiIucgoJcHJpbnRsbihwYXR0ZXJuLmZpbmRGaXJzdEluKGxpbmUpKQp9