[Prev][Next][Index][Thread]

Re: Production 21 (and others)



>Finally, it should be pointed out that although the deterministic
>regular expression for comments is complicated, the comment structure
>itself is very simple and easy to describe:
>
>  Comments begin with '<!--*' and end with '*-->'.
>  Within a comment, anything is legal except '--'.

Very simple rule:

    "<!--*"([^-]|("-"[^-]))*"*-->"

>
>After the TC, these rules can change (and will, unless the ERB rescinds
>its decision of earlier this month) to:
>
>  Comments begin with '<!--*' and end with '*-->'.
>  Within a comment, anything is legal except '*--'.

You and I came up with exactly the same thing:

  "<!--*"([^*]|("*"[^-])|("*-"[^-]))*"*-->"


References: