An optional regular expression asterisk that finds CSS comment

I thought to ask this as an update to my previous similar question , but it got too long.

I tried to understand the regex given in w3.org that matches the css comments and got this doubt

Why do they use

\/\*[^*]*\*+([^/*][^*]*\*+)*\/
----------------^

instead

\/\*[^*]*\*+([^/][^*]*\*+)*\/

?

Both work the same way. Why do they have an extra star?

  • Let's look at this part:

    \*+([^/*][^*]*\*+)*
    -A- --B--     -C-
    

    Regex A , NO MORE stars . , A , - , . [^/] [^/*]?

  • .

    ([ char, / *] [ , *] [ ])

    , . , C , B , .

    , B . , .

w3.org, , . , , .

+5
1

CSS3:

\/\*[^*]*\*+([^/][^*]*\*+)*\/   /* ignore comments */

, , , .

, , CSS2. , , - , .

+3

All Articles