{
    "mode": "perldoc",
    "parameter": "Regexp::Common::list",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Regexp%3A%3ACommon%3A%3Alist/json",
    "generated": "2026-06-12T06:18:31Z",
    "synopsis": "use Regexp::Common qw /list/;\nwhile (<>) {\n/$RE{list}{-pat => '\\w+'}/          and print \"List of words\";\n/$RE{list}{-pat => $RE{num}{real}}/ and print \"List of numbers\";\n}",
    "sections": {
        "NAME": {
            "content": "Regexp::Common::list -- provide regexes for lists\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Regexp::Common qw /list/;\n\nwhile (<>) {\n/$RE{list}{-pat => '\\w+'}/          and print \"List of words\";\n/$RE{list}{-pat => $RE{num}{real}}/ and print \"List of numbers\";\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Please consult the manual of Regexp::Common for a general description of the works of this\ninterface.\n\nDo not use this module directly, but load it via *Regexp::Common*.\n\n$RE{list}{-pat}{-sep}{-lastsep}\nReturns a pattern matching a list of (at least two) substrings.\n\nIf \"-pat=*P*\" is specified, it defines the pattern for each substring in the list. By default,\n*P* is \"qr/.*?\\S/\". In Regexp::Common 0.02 or earlier, the default pattern was \"qr/.*?/\". But\nthat will match a single space, causing unintended parsing of \"a, b, and c\" as a list of four\nelements instead of 3 (with \"-word\" being \"(?:and)\"). One consequence is that a list of the form\n\"a,,b\" will no longer be parsed. Use the pattern \"qr /.*?/\" to be able to parse this, but see\nthe previous remark.\n\nIf \"-sep=*P*\" is specified, it defines the pattern *P* to be used as a separator between each\npair of substrings in the list, except the final two. By default *P* is \"qr/\\s*,\\s*/\".\n\nIf \"-lastsep=*P*\" is specified, it defines the pattern *P* to be used as a separator between the\nfinal two substrings in the list. By default *P* is the same as the pattern specified by the\n\"-sep\" flag.\n\nFor example:\n\n$RE{list}{-pat=>'\\w+'}                # match a list of word chars\n$RE{list}{-pat=>$RE{num}{real}}       # match a list of numbers\n$RE{list}{-sep=>\"\\t\"}                 # match a tab-separated list\n$RE{list}{-lastsep=>',\\s+and\\s+'}     # match a proper English list\n\nUnder \"-keep\":\n\n$1  captures the entire list\n\n$2  captures the last separator\n\n$RE{list}{conj}{-word=*PATTERN*}\nAn alias for $RE{list}{-lastsep=>'\\s*,?\\sPATTERN*\\s*'}\n\nIf \"-word\" is not specified, the default pattern is \"qr/and|or/\".\n\nFor example:\n\n$RE{list}{conj}{-word=>'et'}        # match Jean, Paul, et Satre\n$RE{list}{conj}{-word=>'oder'}      # match Bonn, Koln oder Hamburg\n\n$RE{list}{and}\nAn alias for $RE{list}{conj}{-word=>'and'}\n\n$RE{list}{or}\nAn alias for $RE{list}{conj}{-word=>'or'}\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Regexp::Common for a general description of how to use this interface.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Damian Conway (damian@conway.org)\n",
            "subsections": []
        },
        "MAINTENANCE": {
            "content": "This package is maintained by Abigail (*regexp-common@abigail.be*).\n",
            "subsections": []
        },
        "BUGS AND IRRITATIONS": {
            "content": "Bound to be plenty.\n\nFor a start, there are many common regexes missing. Send them in to *regexp-common@abigail.be*.\n\nLICENSE and COPYRIGHT\nThis software is Copyright (c) 2001 - 2017, Damian Conway and Abigail.\n\nThis module is free software, and maybe used under any of the following licenses:\n\n1) The Perl Artistic License.     See the file COPYRIGHT.AL.\n2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.\n3) The BSD License.               See the file COPYRIGHT.BSD.\n4) The MIT License.               See the file COPYRIGHT.MIT.\n",
            "subsections": []
        }
    },
    "summary": "Regexp::Common::list -- provide regexes for lists",
    "flags": [],
    "examples": [],
    "see_also": []
}