{
    "url": "https://delaparra-services.nl/knowledge-hub/m-multiline",
    "locale": "en",
    "title": "/m (Multiline): Knowledge hub | DeLaParra Services",
    "description": "Makes ^ and $ match the start and end of each line, not just the whole string.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/m-multiline",
        "nl": "https://delaparra-services.nl/nl/kennisbank/m-multiline"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/m-multiline.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/m-multiline.md",
        "json": "https://delaparra-services.nl/knowledge-hub/m-multiline.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/m-multiline.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/m-multiline.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/m-multiline.csv",
            "encodingFormat": "text/csv",
            "name": "m-multiline.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/m-multiline.json",
            "encodingFormat": "application/json",
            "name": "m-multiline.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/m-multiline.md",
            "encodingFormat": "text/markdown",
            "name": "m-multiline.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/m-multiline.pdf",
            "encodingFormat": "application/pdf",
            "name": "m-multiline.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/m-multiline.zip",
            "encodingFormat": "application/zip",
            "name": "m-multiline.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/m-multiline/skills.zip",
            "encodingFormat": "application/zip",
            "name": "m-multiline-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [/m (Multiline)](<https://delaparra-services.nl/knowledge-hub/m-multiline>)\n\n  \n\nCategory: Regex flags \n\n# /m (Multiline)\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is /m (Multiline)?\n\n \n\n/m (Multiline): Makes ^ and $ match the start and end of each line, not just the whole string. The ` m ` flag, short for multiline, changes what ` ^ ` and ` $ ` mean. Normally they match the start and end of the whole string. With ` m `, they match the start and end of every line.\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 /m (Multiline)\n\n  \n\n### How is /m (Multiline) used in practice?\n\n \n\nSo ` /^error/m ` finds lines that begin with error anywhere in a log file. Without the flag it would only check the first line. This is the flag you want when you process text that contains many lines, such as logs, config files or CSV exports.\n\n    \n\n### What should you keep in mind with /m (Multiline)?\n\n \n\nPeople often confuse it with the ` s ` flag, which makes ` . ` match newline characters. They solve different problems and can be combined. If a pattern works on a single line in your test but finds nothing in a real file, a missing ` m ` is a likely cause. If you need the true start or end of the whole string while ` m ` is on, use ` \\A ` and ` \\z `.\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- [/i (Case-Insensitive)](<https://delaparra-services.nl/knowledge-hub/i-case-insensitive>) \n- [/J (Duplicate Named Groups)](<https://delaparra-services.nl/knowledge-hub/j-duplicate-named-groups>) \n- [/L (Locale-dependent)](<https://delaparra-services.nl/knowledge-hub/l-locale-dependent>) \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- [/r (Right-to-Left)](<https://delaparra-services.nl/knowledge-hub/r-right-to-left>)\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/m-multiline/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/m-multiline)\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/m-multiline#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/m-multiline",
                "name": "/m (Multiline): Knowledge hub | DeLaParra Services",
                "description": "Makes ^ and $ match the start and end of each line, not just the whole string.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/m-multiline#term",
                    "name": "/m (Multiline)",
                    "description": "Makes ^ and $ match the start and end of each line, not just the whole string.",
                    "termCode": "m-multiline",
                    "url": "https://delaparra-services.nl/knowledge-hub/m-multiline",
                    "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/m-multiline#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/m-multiline#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/m-multiline#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is /m (Multiline)?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Makes ^ and $ match the start and end of each line, not just the whole string. The m flag, short for multiline, changes what ^ and $ mean. Normally they match the start and end of the whole string. With m, they match the start and end of every line."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is /m (Multiline) used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "So /^error/m finds lines that begin with error anywhere in a log file. Without the flag it would only check the first line. This is the flag you want when you process text that contains many lines, such as logs, config files or CSV exports."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with /m (Multiline)?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "People often confuse it with the s flag, which makes . match newline characters. They solve different problems and can be combined. If a pattern works on a single line in your test but finds nothing in a real file, a missing m is a likely cause. If you need the true start or end of the whole string while m is on, use \\A and \\z."
                        }
                    }
                ],
                "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/m-multiline#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": "/m (Multiline)"
                    }
                ]
            },
            {
                "@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/m-multiline#dataset",
                "name": "/m (Multiline)",
                "description": "Makes ^ and $ match the start and end of each line, not just the whole string.",
                "url": "https://delaparra-services.nl/knowledge-hub/m-multiline",
                "identifier": "https://delaparra-services.nl/knowledge-hub/m-multiline#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/m-multiline#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": "m-multiline.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/m-multiline.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "m-multiline.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/m-multiline.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "m-multiline.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/m-multiline.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "m-multiline.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/m-multiline.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "m-multiline.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/m-multiline.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "m-multiline-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/m-multiline/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:23+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}