I am trying to extract the function name from a function call. For example:
(let ((str "(test-func"))
(if (string-match "^(\\s_+" str)
(message "ok")
(message "no match")))
But this gives "no match"
.. (For simplicity I reduced str
to the start of the real string. A real string could be for example "(test-func a b)"
I think the problem is the \s_
symbol constituent regex..
(test-func
-- then typeM-x re-builder
-- then in between the double quotation marks in the re-builder buffer, type your proposed regexp and see if it works. If it doesn't, then work on the regexp until re-builder shows the highlighting is correct -- e.g., paste the regexp by abo-abo and see the difference. – lawlist Jan 30 '15 at 9:16