Use more idiomatic capture group extraction.