Unfortunately, what you have provided now is still not a complete spec. You might want any of these things:
So, your first task is to create a tight specification. After that you can devise an algorithm and only then start to consider the coding.
In reply to Re^3: Pattern matching
by hippo
in thread Pattern matching
by nursyza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |