Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正規表現に一致するものを見つけて返す関数を探しています\\(\\S-\\)。何も見つからなかった場合はおそらくnilです。検索は、ドキュメントの最初から(point)最後まで検索する必要があります。
\\(\\S-\\)
(point)
使用re-search-forwardとmatch-string:
re-search-forward
match-string
(when (re-search-forward "\\(\\S-\\)" nil t) (match-string 1))
ポイントを移動したくない場合は、ポイントを:でラップしますsave-excursion。
save-excursion
(save-excursion (when ...