Skip to content

Instantly share code, notes, and snippets.

@greister
Created December 4, 2016 15:17
Show Gist options
  • Save greister/4e67222565e4968437c179927e4543d2 to your computer and use it in GitHub Desktop.
Save greister/4e67222565e4968437c179927e4543d2 to your computer and use it in GitHub Desktop.
(defun re-seq (regexp string)
"Get a list of all regexp matches in a string"
(save-match-data
(let ((pos 0)
matches)
(while (string-match regexp string pos)
(push (match-string 0 string) matches)
(setq pos (match-end 0)))
matches)))
(setq reg "'\(.+\)'")
(setq lib-path-string (shell-command-to-string
"node -e 'console.log(module.paths)'"))
(insert (re-seq reg lib-path-string))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment