{
    "content": [
        {
            "type": "text",
            "text": "# Regexp::Common::balanced (perldoc)\n\n## NAME\n\nRegexp::Common::balanced -- provide regexes for strings with balanced parenthesized delimiters or arbitrary delimiters.\n\n## SYNOPSIS\n\nuse Regexp::Common qw /balanced/;\nwhile (<>) {\n/$RE{balanced}{-parens=>'()'}/\nand print q{balanced parentheses\\n};\n}\n\n## DESCRIPTION\n\nPlease consult the manual of Regexp::Common for a general description of the works of this\ninterface.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **SEE ALSO**\n- **AUTHOR**\n- **MAINTENANCE**\n- **BUGS AND IRRITATIONS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Regexp::Common::balanced",
        "section": "",
        "mode": "perldoc",
        "summary": "Regexp::Common::balanced -- provide regexes for strings with balanced parenthesized delimiters or arbitrary delimiters.",
        "synopsis": "use Regexp::Common qw /balanced/;\nwhile (<>) {\n/$RE{balanced}{-parens=>'()'}/\nand print q{balanced parentheses\\n};\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 36,
                "subsections": [
                    {
                        "name": "Note",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MAINTENANCE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS AND IRRITATIONS",
                "lines": 14,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Regexp::Common::balanced -- provide regexes for strings with balanced parenthesized delimiters\nor arbitrary delimiters.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Regexp::Common qw /balanced/;\n\nwhile (<>) {\n/$RE{balanced}{-parens=>'()'}/\nand print q{balanced parentheses\\n};\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{balanced}{-parens}\nReturns a pattern that matches a string that starts with the nominated opening parenthesis or\nbracket, contains characters and properly nested parenthesized subsequences, and ends in the\nmatching parenthesis.\n\nMore than one type of parenthesis can be specified:\n\n$RE{balanced}{-parens=>'(){}'}\n\nin which case all specified parenthesis types must be correctly balanced within the string.\n\nSince version 2013030901, $1 will always be set (to the entire matched substring), regardless\nwhether \"{-keep}\" is used or not.\n\n$RE{balanced}{-begin => \"begin\"}{-end => \"end\"}\nReturns a pattern that matches a string that is properly balanced using the *begin* and *end*\nstrings as start and end delimiters. Multiple sets of begin and end strings can be given by\nseparating them by \"|\"s (which can be escaped with a backslash).\n\nqr/$RE{balanced}{-begin => \"do|if|case\"}{-end => \"done|fi|esac\"}/\n\nwill match properly balanced strings that either start with *do* and end with *done*, start with\n*if* and end with *fi*, or start with *case* and end with *esac*.\n\nIf *-end* contains less cases than *-begin*, the last case of *-end* is repeated. If it contains\nmore cases than *-begin*, the extra cases are ignored. If either of *-begin* or *-end* isn't\ngiven, or is empty, *-begin => '('* and *-end => ')'* are assumed.\n\nSince version 2013030901, $1 will always be set (to the entire matched substring), regardless\nwhether \"{-keep}\" is used or not.\n",
                "subsections": [
                    {
                        "name": "Note",
                        "content": "Since version 2013030901 the pattern will make of the recursive construct \"(?-1)\", instead of\nusing the problematic \"(??{ })\" construct. This fixes an problem that was introduced in the 5.17\ndevelopment track.\n"
                    }
                ]
            },
            "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": []
            }
        }
    }
}