I'm looking for a function which will try to find and return whatever was matched by the regular expression \\(\\S-\\)
and probably nil if nothing was found. The search should start from (point)
and search to the end of the document.
views:
67answers:
1
+6
A:
Use re-search-forward
and match-string
:
(when (re-search-forward "\\(\\S-\\)" nil t)
(match-string 1))
If you don't want point to move, wrap it in a save-excursion
:
(save-excursion
(when ...
scottfrazer
2009-04-19 22:18:13