{
    "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left",
    "locale": "en",
    "title": "/r (Right-to-Left): Knowledge hub | DeLaParra Services",
    "description": "Scans the input from right to left instead of left to right — matters for lookaround direction and where scanning starts.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/r-right-to-left",
        "nl": "https://delaparra-services.nl/nl/kennisbank/r-right-to-left"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.md",
        "json": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.csv",
            "encodingFormat": "text/csv",
            "name": "r-right-to-left.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.json",
            "encodingFormat": "application/json",
            "name": "r-right-to-left.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.md",
            "encodingFormat": "text/markdown",
            "name": "r-right-to-left.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.pdf",
            "encodingFormat": "application/pdf",
            "name": "r-right-to-left.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.zip",
            "encodingFormat": "application/zip",
            "name": "r-right-to-left.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left/skills.zip",
            "encodingFormat": "application/zip",
            "name": "r-right-to-left-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [/r (Right-to-Left)](<https://delaparra-services.nl/knowledge-hub/r-right-to-left>)\n\n  \n\nCategory: Regex flags \n\n# /r (Right-to-Left)\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is /r (Right-to-Left)?\n\n \n\n/r (Right-to-Left): Scans the input from right to left instead of left to right — matters for lookaround direction and where scanning starts. Right-to-left mode, available in .NET as ` RegexOptions.RightToLeft `, makes the engine start at the end of the text and move backwards. The first match it reports is the last one in the string.\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 /r (Right-to-Left)\n\n  \n\n### How is /r (Right-to-Left) used in practice?\n\n \n\nThat is handy when you want the final occurrence of something, such as the file extension after the last dot, or the last number in a line. With normal matching you would need a greedy prefix or extra code to find it.\n\n    \n\n### What should you keep in mind with /r (Right-to-Left)?\n\n \n\nIt also changes how lookarounds and some quantifiers behave, so a pattern that works left to right may give different results in this mode. Most other engines do not support it at all. If your code may move to another language, prefer a portable approach, such as matching with ` $ ` at the end, or splitting the string and taking the last part.\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- [/m (Multiline)](<https://delaparra-services.nl/knowledge-hub/m-multiline>) \n- [/n (Explicit Capture)](<https://delaparra-services.nl/knowledge-hub/n-explicit-capture>) \n- [/o (Once (interpolate once))](<https://delaparra-services.nl/knowledge-hub/o-once-interpolate-once>) \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- [/u (Unicode)](<https://delaparra-services.nl/knowledge-hub/u-unicode>)\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/r-right-to-left/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/r-right-to-left)\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/r-right-to-left#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left",
                "name": "/r (Right-to-Left): Knowledge hub | DeLaParra Services",
                "description": "Scans the input from right to left instead of left to right — matters for lookaround direction and where scanning starts.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/r-right-to-left#term",
                    "name": "/r (Right-to-Left)",
                    "description": "Scans the input from right to left instead of left to right — matters for lookaround direction and where scanning starts.",
                    "termCode": "r-right-to-left",
                    "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left",
                    "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/r-right-to-left#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/r-right-to-left#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/r-right-to-left#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is /r (Right-to-Left)?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Scans the input from right to left instead of left to right — matters for lookaround direction and where scanning starts. Right-to-left mode, available in .NET as RegexOptions.RightToLeft, makes the engine start at the end of the text and move backwards. The first match it reports is the last one in the string."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is /r (Right-to-Left) used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "That is handy when you want the final occurrence of something, such as the file extension after the last dot, or the last number in a line. With normal matching you would need a greedy prefix or extra code to find it."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with /r (Right-to-Left)?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "It also changes how lookarounds and some quantifiers behave, so a pattern that works left to right may give different results in this mode. Most other engines do not support it at all. If your code may move to another language, prefer a portable approach, such as matching with $ at the end, or splitting the string and taking the last part."
                        }
                    }
                ],
                "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/r-right-to-left#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": "/r (Right-to-Left)"
                    }
                ]
            },
            {
                "@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/r-right-to-left#dataset",
                "name": "/r (Right-to-Left)",
                "description": "Scans the input from right to left instead of left to right — matters for lookaround direction and where scanning starts.",
                "url": "https://delaparra-services.nl/knowledge-hub/r-right-to-left",
                "identifier": "https://delaparra-services.nl/knowledge-hub/r-right-to-left#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/r-right-to-left#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": "r-right-to-left.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "r-right-to-left.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "r-right-to-left.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "r-right-to-left.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "r-right-to-left.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/r-right-to-left.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "r-right-to-left-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/r-right-to-left/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}