(require 'stdlib) (define str "Package: telnet") (string-match "(\\w+): (.*)" str) (puts (match-start 0)) (puts (match-end 0)) (puts (match-start 1)) (puts (match-end 1)) (puts (match-start 2)) (puts (match-end 2)) (puts (substring str (match-start 1) (match-end 1))) (puts (substring str (match-start 2) (match-end 2))) (puts (expand-last-match "\\1: \\2")))