I want to match CSS custom properties with the Regxr pattern.
So I tried with /^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/gim which works fine with normal characters, but when it comes to emoji or other language characters, it doesn't work as expected.
--monster-x: purple;
--monster--x: red;
--monster-仮-x: blue;
Example:
How can I match all possible/supported CSS custom properties? Is there any doc for allowed/disallowed characters in CSS custom properties?
Thanks.

You'll need to expand your character list (
[]) using the following:Emoji's
JavaScript regular expression for Unicode emoji
Chinese characters
Javascript unicode string, chinese character but no punctuation
Combining those char lists with your existing one will give us the following regex:
> Regex 101 Demo