{
    "content": [
        {
            "type": "text",
            "text": "# Test::Unit::Assertion::Regexp (perldoc)\n\n## NAME\n\nTest::Unit::Assertion::Regexp - Assertion with regex matching\n\n## SYNOPSIS\n\nrequire Test::Unit::Assertion::Regexp;\nmy $assertre =\nTest::Unit::Assertion::Regexp->new(qr/apattern/);\n$assertre->doassertion('astring');\nThis is rather more detail than the average user will need. Test::Unit::Assertion::Regexp\nobjects are generated automagically by Test::Unit::Assert::assert when it is passed a regular\nexpression as its first parameter.\nsub testfoo {\n...\n$self->assert(qr/somepattern/, $result);\n}\nIf the assertion fails then the object throws an exception with details of the pattern and the\nstring it failed to match against.\nNote that if you need to do a 'string does *not* match this pattern' type of assertion then you\ncan do:\n$self->assert(qr/(?!somepattern)/, $somestring)\nie. Make use of the negative lookahead assertion.\n\n## DESCRIPTION\n\nThe class is used by the framework to provide sensible 'automatic' reports when a match fails.\nThe old:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **IMPLEMENTS**\n- **DESCRIPTION**\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Test::Unit::Assertion::Regexp",
        "section": "",
        "mode": "perldoc",
        "summary": "Test::Unit::Assertion::Regexp - Assertion with regex matching",
        "synopsis": "require Test::Unit::Assertion::Regexp;\nmy $assertre =\nTest::Unit::Assertion::Regexp->new(qr/apattern/);\n$assertre->doassertion('astring');\nThis is rather more detail than the average user will need. Test::Unit::Assertion::Regexp\nobjects are generated automagically by Test::Unit::Assert::assert when it is passed a regular\nexpression as its first parameter.\nsub testfoo {\n...\n$self->assert(qr/somepattern/, $result);\n}\nIf the assertion fails then the object throws an exception with details of the pattern and the\nstring it failed to match against.\nNote that if you need to do a 'string does *not* match this pattern' type of assertion then you\ncan do:\n$self->assert(qr/(?!somepattern)/, $somestring)\nie. Make use of the negative lookahead assertion.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "IMPLEMENTS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Test::Unit::Assertion::Regexp - Assertion with regex matching\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "require Test::Unit::Assertion::Regexp;\n\nmy $assertre =\nTest::Unit::Assertion::Regexp->new(qr/apattern/);\n\n$assertre->doassertion('astring');\n\nThis is rather more detail than the average user will need. Test::Unit::Assertion::Regexp\nobjects are generated automagically by Test::Unit::Assert::assert when it is passed a regular\nexpression as its first parameter.\n\nsub testfoo {\n...\n$self->assert(qr/somepattern/, $result);\n}\n\nIf the assertion fails then the object throws an exception with details of the pattern and the\nstring it failed to match against.\n\nNote that if you need to do a 'string does *not* match this pattern' type of assertion then you\ncan do:\n\n$self->assert(qr/(?!somepattern)/, $somestring)\n\nie. Make use of the negative lookahead assertion.\n",
                "subsections": []
            },
            "IMPLEMENTS": {
                "content": "Test::Unit::Assertion::Regexp implements the Test::Unit::Assertion interface, which means it can\nbe plugged into the Test::Unit::TestCase and friends' \"assert\" method with no ill effects.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The class is used by the framework to provide sensible 'automatic' reports when a match fails.\nThe old:\n\n$self->assert(scalar($foo =~ /pattern/), \"$foo didn't match /.../\");\n\nseems rather clumsy compared to this. If the regexp assertion fails, then the user is given a\nsensible error message, with the pattern and the string that failed to match it...\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Copyright (c) 2001 Piers Cawley <pdcawley@iterative-software.com>.\n\nAll rights reserved. This program is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "*   Test::Unit::TestCase\n\n*   Test::Unit::Assertion\n",
                "subsections": []
            }
        }
    }
}