by shigemk2

当面は技術的なことしか書かない

マッチした文字列の抽出

(save-match-data ; is usually a good idea
      (and (string-match "\\`\\([^@]+\\)@\\([^@]+\\)\\'" email)
           (setq user (match-string 1 email)
                 domain (match-string 2 email) ) ))

save-match-dataとstring-matchのコンボ。

EmacsWiki: Elisp Cookbook