0

I write text files in the MoinMoin Wiki markup language in a text editor (emacs). When I mis-place one of the special tags my whole page gets mangled with the wrong formatting -- or worse. I always close a formatting element on the same line where I opened it.

Can I use gnu grep to find mismatching Wiki-tags on a line? Like:

  • << macroname ( params ) >>
  • backtick code backtick
  • '' double quotes for italics '' -- probably difficult
  • ''' triple quotes for bold ''' -- probably difficult

I normally do not nest tags. So there is no "bold code" or "bold italics".

1 Answer 1

1

No in general. grep is line oriented tools and regex is less powered then context free gramma. If you try write:

grep -v '<<[^>]>>' <file

you miss in match:

<<good>>  <<bad>d>

But you already use Emacs and some checks already included:

M-x check-parens RET!

If you read http://moinmo.in/HelpOnParsers you can learn that writing parser for MoinMoin is hard task.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .