Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage{expl3}
- \ExplSyntaxOn
- \regex_const:Nn \q_capitals {\A[A-Z]\Z}
- \cs_generate_variant:Nn \regex_match:NnTF {NfTF}
- \cs_new_protected:Npn \q_normalize:n #1 {
- \tl_head:n {#1}
- \regex_match:NfTF \q_capitals {\tl_head:n {#1}}
- {\tl_use:N \tl_upper_case:n {\tl_tail:n {#1}}}
- {\tl_use:N \tl_lower_case:n {\tl_tail:n {#1}}}
- }
- \tl_new:N \foo
- \tl_set:Nn \foo { quux }
- \begin{document}
- \tl_use:c { \q_normalize:n {fOO} } ~
- \end{document}
Add Comment
Please, Sign In to add comment