Skip to main content

Timeline for How to extract markups?

Current License: CC BY-SA 4.0

9 events
when toggle format what by license comment
Oct 18, 2023 at 23:15 vote accept crocefisso
Oct 17, 2023 at 13:11 comment added crocefisso Thank you for your explanations, (shell-command-on-region b e "grep -o '\\*[^*]*\\*' > ~/tmp/tmo") worked perfectly (I updated the solution accordingly).
Oct 17, 2023 at 11:44 comment added NickD Also, * inside a character class construct [...] is not special and does not have to be escaped. In fact, trying to escape it as you have done, changes the meaning of the character class: "[^\\*]" (the Emacs string form) means any character other than backslash or asterisk. It's always good to remember what JWZ said about regexps, even if you do decide to use them.
Oct 17, 2023 at 11:24 comment added NickD You need to double up backslashes in Emacs strings. That's one reason that none of these solutions is ideal (and there are many others). They should all be looked at with a jaundiced eye.
Oct 17, 2023 at 2:27 comment added crocefisso Thank you @NickD. I notice something strange: grep -o '\*[^\*]*\*' ~/tmp/tmp.org > test.org works well on a terminal, but from emacs, (shell-command-on-region b e "grep -o '\*[^\*]*\*' > ~/tmp/tm") doesn't...
Oct 17, 2023 at 1:29 answer added crocefisso timeline score: 0
Oct 16, 2023 at 20:52 comment added NickD grep -o '_[^_]*_' /tmp/foo4.org is a start: you only need to get rid of the surrounding underscores. The only problem is the usual one of underscores that are not markup. It should be easy to turn that into an Emacs function (if worse comes to worst, the function can run the grep command, more-or-less as is).
Oct 16, 2023 at 20:12 history edited Drew
edited tags
Oct 16, 2023 at 19:23 history asked crocefisso CC BY-SA 4.0