MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Ripple",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "10": {
                "pageid": 10,
                "ns": 0,
                "title": "Regular Expressions",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "Regular expressions or regexp are used to find strings in text.\n\n[[Perl]], [[PHP]] and [[Python]] support all in below table. [[:Category:Bash|Bash]] and [[SQL]] only support the POSIX part.\n\n{| class=\"wikitable\"\n|-\n|.||Any character except newline (POSIX)||\\c||Control character\n|-\n|\\d||Digit||\\D||non Digit\n|-\n|\\s||Whitespace||\\S||non Whitespace\n|-\n|\\w||Word character [A-Za-z0-9]||\\W||non Word character\n|-\n|^||Start of string (POSIX)||$||End of string (POSIX)\n|-\n|*||0 or more matches of previous expression (POSIX)||( )||Subexpression (POSIX)\n|-\n|<nowiki>+</nowiki>||1 or more matches of previous expression (POSIX)||[ ]||Match any of the characters between the [ ].<br>^as first character negates the match (POSIX)\n|-\n|<nowiki>?</nowiki>||0 or 1 matches of previous expression.<br>Stop search as soon as next expression is found (non greedy) (POSIX)||{x,y}||Match the previous expression between x an y times.<br>When y is ommited match exactly x times (POSIX)\n|-\n|<nowiki>\\n</nowiki>||Refers to the Nth subexpression (POSIX)|| ||\n|}\n\n==Examples==\n;<code>/[^/]*$</code>\n:Match last / and everything following\n\n==Perl==\n\n;perl -lne 'print $1 if (/<regexp(subexp)>/)'\n:Commandline to print the first subexp in a match.\n\n;$var =~ /<pattern>/\n:Generic syntax, this expression is true if the pattern is matched in $var\n\n;@array = $var =~ m/<pattern>/g;\n:Put all matches (or all first submatches) of <pattern> in var into @array\n\nFollowing variables are when a match is made:\n\n;$&\n:Contains the string matched by the last pattern match\n;$`\n:The string preceding whatever was matched by the last pattern match, not counting patterns matched in nested blocks that have been exited already.\n;$'\n:The string following whatever was matched by the last pattern match, not counting patterns matched in nested blocks that have been exited already.<br>Example:\n<syntaxhighlight lang=perl>\n    $_ = 'abcdefghi';\n    /def/;\n    print \"$`:$&:$'\";\n    # prints abc:def:ghi\n</syntaxhighlight>\n\n;$1\n:String matched by the first subexpression.\n\n;$+\n:The last bracket matched by the last search pattern. This is useful if you don't know which of a set of alternative patterns matched.<br>Example:\n<syntaxhighlight lang=perl>\n    /Version: (.*)|Revision: (.*)/\n    && ($rev = $+);\n</syntaxhighlight>\n\n==Python==\nCheck [[Python:Strings#Regular_Expressions_(regexp)]]"
                    }
                ]
            },
            "178": {
                "pageid": 178,
                "ns": 0,
                "title": "Resources",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "[[Category:Python]]\n\nThe resources modules provides information about the current process.\n\n<syntaxhighlight lang=python>\nimport resource\nresource.getrusage(resource.RUSAGE_SELF)\n\nresource.struct_rusage(ru_utime=0.008208, ru_stime=0.013339, ru_maxrss=5164, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=1420, ru_majflt=2, ru_nswap=0, ru_inblock=1520, ru_oublock=0, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=92, ru_nivcsw=1)\n</syntaxhighlight>\n\nYou can address the individual items as e.g <code>resource.getrusage(resource.RUSAGE_SELF).ru_maxrss</code>"
                    }
                ]
            }
        }
    }
}