Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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".

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.