{
    "url": "https://delaparra-services.nl/knowledge-hub/u-unicode",
    "locale": "en",
    "title": "/u (Unicode): Knowledge hub | DeLaParra Services",
    "description": "Treats the pattern as a sequence of Unicode code points, not bytes. Enables \\u{...} escapes and \\p{...} property matches.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/u-unicode",
        "nl": "https://delaparra-services.nl/nl/kennisbank/u-unicode"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/u-unicode.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/u-unicode.md",
        "json": "https://delaparra-services.nl/knowledge-hub/u-unicode.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/u-unicode.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/u-unicode.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/u-unicode.csv",
            "encodingFormat": "text/csv",
            "name": "u-unicode.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/u-unicode.json",
            "encodingFormat": "application/json",
            "name": "u-unicode.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/u-unicode.md",
            "encodingFormat": "text/markdown",
            "name": "u-unicode.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/u-unicode.pdf",
            "encodingFormat": "application/pdf",
            "name": "u-unicode.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/u-unicode.zip",
            "encodingFormat": "application/zip",
            "name": "u-unicode.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/u-unicode/skills.zip",
            "encodingFormat": "application/zip",
            "name": "u-unicode-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [/u (Unicode)](<https://delaparra-services.nl/knowledge-hub/u-unicode>)\n\n  \n\nCategory: Regex flags \n\n# /u (Unicode)\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is /u (Unicode)?\n\n \n\n/u (Unicode): Treats the pattern as a sequence of Unicode code points, not bytes. Enables \\\\u{...} escapes and \\\\p{...} property matches. The ` u ` flag tells the regex engine to treat the text as Unicode characters instead of bytes. In JavaScript it enables ` \\u{1F600} ` escapes and property classes like ` \\p{L} ` for any letter. In PHP it makes PCRE read the subject as UTF-8.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about /u (Unicode)\n\n  \n\n### How is /u (Unicode) used in practice?\n\n \n\nWithout it, characters outside the basic range are split into pieces. An emoji or an accented letter can count as two characters, so ` . ` matches half of it and length checks go wrong.\n\n    \n\n### What should you keep in mind with /u (Unicode)?\n\n \n\nUse it whenever the input can contain text written by people, which is almost always. In PHP, ` preg_match('/^\\p{L}+$/u', $name) ` accepts names like Zoë and Łukasz. Without ` u `, the same pattern rejects them or corrupts them. There is one more benefit: with ` u `, PHP rejects invalid UTF-8 input instead of matching garbage, which surfaces encoding bugs early.\n\n \n\n## At a glance\n\n   CategoryRegex flags Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More Regex flags terms\n\n \n\n- [/r (Right-to-Left)](<https://delaparra-services.nl/knowledge-hub/r-right-to-left>) \n- [/s (DotAll (single line))](<https://delaparra-services.nl/knowledge-hub/s-dotall-single-line>) \n- [/U (Ungreedy)](<https://delaparra-services.nl/knowledge-hub/u-ungreedy>) \n- [/v (Unicode Sets)](<https://delaparra-services.nl/knowledge-hub/v-unicode-sets>) \n- [/x (Extended / Verbose)](<https://delaparra-services.nl/knowledge-hub/x-extended-verbose>) \n- [/y (Sticky)](<https://delaparra-services.nl/knowledge-hub/y-sticky>)\n\n \n\n[All terms starting with a number or symbol](<https://delaparra-services.nl/knowledge-hub#letter-other>)\n\n \n\n## Skills\n\n \n\n- ### Regex flags across languages\n\n \n\nUse when writing, porting or debugging a regular expression and its flags/modifiers across languages and tools - JavaScript (g i m s u v y d), PCRE/PHP (i m s x u A D U J), Python re (re.I, re.M, re.S, re.X, re.A), .NET (RegexOptions), POSIX grep/sed. Also use for Laravel \\`regex:\\` validation rules and for catastrophic backtracking risks.\n\n [View skill](<https://delaparra-services.nl/skills/regex-flags-cross-language>) [Download zip](<https://delaparra-services.nl/skills/regex-flags-cross-language/download>) \n- ### Regex builder\n\n \n\nUse when the user asks to create, debug, explain, validate, or optimize a regular expression or replacement for a specific engine. Verifies representative matches, non-matches, captures, escaping, portability limits, and backtracking risk in the target runtime.\n\n [View skill](<https://delaparra-services.nl/skills/regex-builder>) [Download zip](<https://delaparra-services.nl/skills/regex-builder/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/u-unicode/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [Regex for beginners](<https://delaparra-services.nl/manuals/regex-voor-beginners>) \n- [Installing Visual Studio Code](<https://delaparra-services.nl/manuals/visual-studio-code-installeren>)\n\n \n\n## Related services\n\n \n\n- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)\n\nPerhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.\n\n \n\n## Need any help?\n\n \n\nStuck 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.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/u-unicode)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/u-unicode",
                "name": "/u (Unicode): Knowledge hub | DeLaParra Services",
                "description": "Treats the pattern as a sequence of Unicode code points, not bytes. Enables \\u{...} escapes and \\p{...} property matches.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#term",
                    "name": "/u (Unicode)",
                    "description": "Treats the pattern as a sequence of Unicode code points, not bytes. Enables \\u{...} escapes and \\p{...} property matches.",
                    "termCode": "u-unicode",
                    "url": "https://delaparra-services.nl/knowledge-hub/u-unicode",
                    "inLanguage": "en",
                    "keywords": "Regex flags",
                    "dateModified": "2026-11-25T17:46:23+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is /u (Unicode)?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Treats the pattern as a sequence of Unicode code points, not bytes. Enables \\u{...} escapes and \\p{...} property matches. The u flag tells the regex engine to treat the text as Unicode characters instead of bytes. In JavaScript it enables \\u{1F600} escapes and property classes like \\p{L} for any letter. In PHP it makes PCRE read the subject as UTF-8."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is /u (Unicode) used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Without it, characters outside the basic range are split into pieces. An emoji or an accented letter can count as two characters, so . matches half of it and length checks go wrong."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with /u (Unicode)?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Use it whenever the input can contain text written by people, which is almost always. In PHP, preg_match('/^\\p{L}+$/u', $name) accepts names like Zoë and Łukasz. Without u, the same pattern rejects them or corrupts them. There is one more benefit: with u, PHP rejects invalid UTF-8 input instead of matching garbage, which surfaces encoding bugs early."
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/regex-flags-cross-language#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/regex-builder#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/regex-voor-beginners#article"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/visual-studio-code-installeren#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "/u (Unicode)"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#dataset",
                "name": "/u (Unicode)",
                "description": "Treats the pattern as a sequence of Unicode code points, not bytes. Enables \\u{...} escapes and \\p{...} property matches.",
                "url": "https://delaparra-services.nl/knowledge-hub/u-unicode",
                "identifier": "https://delaparra-services.nl/knowledge-hub/u-unicode#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/u-unicode#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "Regex flags",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:23+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "u-unicode.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/u-unicode.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "u-unicode.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/u-unicode.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "u-unicode.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/u-unicode.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "u-unicode.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/u-unicode.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "u-unicode.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/u-unicode.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "u-unicode-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/u-unicode/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}