DELAPARRA
Index
Color
NL
Category: Regex flags

/v (Unicode Sets)

Explained by Updated

What is /v (Unicode Sets)?

/v (Unicode Sets): An upgraded version of /u (ES2024) that also supports set operations on character classes — union, intersection, and difference. The v flag is a newer, stricter version of u in JavaScript, added in ES2024. It keeps all the Unicode behaviour and adds set operations inside character classes. You can now write [\p{L}--[a-z]] for letters except lowercase ASCII, or [\p{Script=Greek}&&\p{Letter}] for the overlap of two sets. It also supports properties of strings, such as \p{RGI_Emoji}, which matches complete emoji including those made from several code points.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about /v (Unicode Sets)

What should you keep in mind with /v (Unicode Sets)?

The stricter syntax means some characters must be escaped inside classes, so a pattern that worked with u may throw an error with v. Use v in new code that runs on current browsers and Node 20 or later. For validation rules that combine several Unicode categories, it replaces long, fragile lists of ranges with something you can read.

At a glance

CategoryRegex flags
Explained by
Updated

More Regex flags terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.