{
    "content": [
        {
            "type": "text",
            "text": "# BSON::Regex (perldoc)\n\n## NAME\n\nBSON::Regex - BSON type wrapper for regular expressions\n\n## SYNOPSIS\n\nuse BSON::Types ':all';\n$regex = bsonregex( $pattern );\n$regex = bsonregex( $pattern, $flags );\n\n## DESCRIPTION\n\nThis module provides a BSON type wrapper for a PCRE regular expression and optional flags.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ATTRIBUTES**\n- **METHODS**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "BSON::Regex",
        "section": "",
        "mode": "perldoc",
        "summary": "BSON::Regex - BSON type wrapper for regular expressions",
        "synopsis": "use BSON::Types ':all';\n$regex = bsonregex( $pattern );\n$regex = bsonregex( $pattern, $flags );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "ATTRIBUTES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "BSON::Regex - BSON type wrapper for regular expressions\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version v1.12.2\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use BSON::Types ':all';\n\n$regex = bsonregex( $pattern );\n$regex = bsonregex( $pattern, $flags );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides a BSON type wrapper for a PCRE regular expression and optional flags.\n",
                "subsections": []
            },
            "ATTRIBUTES": {
                "content": "pattern\nA string containing a PCRE regular expression pattern (not a \"qr\" object and without slashes).\nDefault is the empty string.\n\nflags\nA string with regular expression flags. Flags will be sorted and duplicates will be removed\nduring object construction. Supported flags include \"imxlsu\". Invalid flags will cause an\nexception. Default is the empty string.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "trycompile\nmy $qr = $regexp->trycompile;\n\nTries to compile the \"pattern\" and \"flags\" into a reference to a regular expression. If the\npattern or flags can't be compiled, a exception will be thrown.\n\nSECURITY NOTE: Executing a regular expression can evaluate arbitrary code if the re 'eval'\npragma is in force. You are strongly advised to read re and never to use untrusted input with\n\"trycompile\".\n\nTOJSON\nIf the \"BSONEXTJSON\" option is true, returns a hashref compatible with MongoDB's extended JSON\n<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst> format, which\nrepresents it as a document as follows:\n\n{\"$regularExpression\" : { pattern: \"<pattern>\", \"options\" : \"<flags>\"} }\n\nIf the \"BSONEXTJSON\" option is false, an error is thrown, as this value can't otherwise be\nrepresented in JSON.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "*   David Golden <david@mongodb.com>\n\n*   Stefan G. <minimalist@lavabit.com>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.\n\nThis is free software, licensed under:\n\nThe Apache License, Version 2.0, January 2004\n",
                "subsections": []
            }
        }
    }
}