/* html2txt3.l flex file for converting html to txt (sort of...) Daniel Scharstein 2/18/08 3rd version - added comments and "pre" tags */ ws [ \t\n]|" " tag "<"[^>]*">" nltag "<""/"?"h"[1-6]">"|"

"|"
"|""|"" noTwoDashes [^-]*("-"[^-]+)* comment "" %s PRE %% int ol = 0; "

    " { ol = 1; } "
" { ol = 0; } "
  • " { if (ol > 0) printf("\n %d. ", ol++); else printf("\n * "); } "
    "   { BEGIN(PRE); }
    "
    " { BEGIN(INITIAL); } {comment} {} {nltag} {printf("\n");} {tag} {} {ws}+ {printf(" ");} ">" {printf(">");} "<" {printf("<");} "&" {printf("&");}