Another solution would be to look for the hash-bang line that would seem to denote the start of code, then collect it and everything up to and including the last semi-colon, and wrap in code tags. Not a perfect solution, and I'm not sure how feasible (what with everyone having different hash-bang lines and all), but a possible solution.
We could just make everything in the text box preformatted with a PRE tag. That wouldn't be a perfect solution either, but still a possible solution.
#!/usr/bin/perl use warnings; use strict; #testing pre and code
Update:
After seeing kudra's response, it shouldn't be that hard to run a regexp against everyone's post (non-greedy) to be able to split up code and text. Having two code blocks could be as easy as a good rexexp.
J. J. Horner Linux, Perl, Apache, Stronghold, Unix jhorner@knoxlug.org http://www.knoxlug.org/
In reply to RE: Automatic CODE tags
by jjhorner
in thread Automatic CODE tags
by Odud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |