Q: How can I strip non-word characters from a string?
For an arbitrary string, how do I strip all characters with non-word syntax? Alternately, using a regexp, how do I strip out the non-alphabetic characters?
Hypothetical example:
(some-fnx "#here's a string!") ; => "heres a string"
Specific application:
I want to get a list of the LaTeX font commands without the markup syntax. The value of LaTeX-font-list
is:
((1 "" "" "\\mathcal{" "}")
(2 "\\textbf{" "}" "\\mathbf{" "}")
(3 "\\textsc{" "}")
(5 "\\emph{" "}")
(6 "\\textsf{" "}" "\\mathsf{" "}")
(9 "\\textit{" "}" "\\mathit{" "}")
(13 "\\textmd{" "}")
(14 "\\textnormal{" "}" "\\mathnormal{" "}")
(18 "\\textrm{" "}" "\\mathrm{" "}")
(19 "\\textsl{" "}" "\\mathbb{" "}")
(20 "\\texttt{" "}" "\\mathtt{" "}")
(21 "\\textup{" "}")
(4 "" "" t))
I want to iterate through the nested lists in order to get returned values like "textbf", "textrm", etc., without the rest of the markup.