{"id":3156,"date":"2021-11-29T16:33:48","date_gmt":"2021-11-29T16:33:48","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=3156"},"modified":"2021-12-03T07:59:30","modified_gmt":"2021-12-03T07:59:30","slug":"python-regex-quantifiers","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/python-regex\/python-regex-quantifiers\/","title":{"rendered":"Python Regex Quantifiers"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use Python regex quantifiers to define how many times a character or a character set can be repeated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-python-regex-quantifiers'>Introduction to Python regex quantifiers <a href=\"#introduction-to-python-regex-quantifiers\" class=\"anchor\" id=\"introduction-to-python-regex-quantifiers\" title=\"Anchor for Introduction to Python regex quantifiers\">#<\/a><\/h2>\n\n\n\n<p>In <a href=\"https:\/\/www.pythontutorial.net\/python-regex\/python-regular-expressions\/\">regular expressions<\/a>, quantifiers match the preceding characters or character sets a number of times. The following table shows all the quantifiers and their meanings:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Quantifier<\/th><th>Name<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>*<\/code><\/td><td>Asterisk<\/td><td>Match its preceding element zero or more times.<\/td><\/tr><tr><td><code>+<\/code><\/td><td>Plus<\/td><td>Match its preceding element one or more times.<\/td><\/tr><tr><td><code>?<\/code><\/td><td>Question Mark<\/td><td>Match its preceding element zero or one time.<\/td><\/tr><tr><td><code>{<\/code>&nbsp;<em>n<\/em>&nbsp;<code>}<\/code><\/td><td>Curly Braces<\/td><td>Match its preceding element exactly&nbsp;<code>n<\/code>&nbsp;times.<\/td><\/tr><tr><td><code>{<\/code>&nbsp;<em>n<\/em>&nbsp;<code>,}<\/code><\/td><td>Curly Braces <\/td><td>Match its preceding element at least&nbsp;<code>n<\/code>&nbsp;times.<\/td><\/tr><tr><td><code>{<\/code>&nbsp;<em>n<\/em>&nbsp;<code>,<\/code>&nbsp;<em>m<\/em>&nbsp;<code>}<\/code><\/td><td>Curly Braces <\/td><td>Match its preceding element  from&nbsp;<code>n<\/code>&nbsp;to&nbsp;<code>m<\/code> times.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='match-zero-or-more-times'>Match zero or more times (*) <a href=\"#match-zero-or-more-times\" class=\"anchor\" id=\"match-zero-or-more-times\" title=\"Anchor for Match zero or more times (&lt;code&gt;*&lt;\/code&gt;)\">#<\/a><\/h3>\n\n\n\n<p>The quantifier (<code>*<\/code>) matches its preceding element zero or more times. For example, the following program uses the <code>*<\/code> quantifier to match any string that ends with <code>Python<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> re\n\ns = <span class=\"hljs-string\">\"\"\"CPython, IronPython, and JPython \n       are major Python's implementation\"\"\"<\/span>\n\nmatches = re.finditer(<span class=\"hljs-string\">'\\w*Python'<\/span>, s)\n\n<span class=\"hljs-keyword\">for<\/span> match <span class=\"hljs-keyword\">in<\/span> matches:\n    print(match)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The <code>\\w<\/code> matches any single word character.<\/li><li>So the <code>\\w*<\/code> matches zero or more word characters.<\/li><li>Therefore, the <code>\\w*Python<\/code> match any zero or more characters followed by the string <code>Python<\/code>.<\/li><\/ul>\n\n\n\n<p>As a result, the <code>\\w*Python<\/code> pattern matches <code>CPython<\/code>, <code>IronPython<\/code>, <code>JPython<\/code>, and <code>Python<\/code> in the string:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">&lt;re.Match object; span=(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">7<\/span>), match=<span class=\"hljs-string\">'CPython'<\/span>&gt;\n&lt;re.Match object; span=(<span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">19<\/span>), match=<span class=\"hljs-string\">'IronPython'<\/span>&gt;\n&lt;re.Match object; span=(<span class=\"hljs-number\">25<\/span>, <span class=\"hljs-number\">32<\/span>), match=<span class=\"hljs-string\">'JPython'<\/span>&gt;  \n&lt;re.Match object; span=(<span class=\"hljs-number\">51<\/span>, <span class=\"hljs-number\">57<\/span>), match=<span class=\"hljs-string\">'Python'<\/span>&gt;  <\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='match-one-or-more-times'>Match one or more times (+) <a href=\"#match-one-or-more-times\" class=\"anchor\" id=\"match-one-or-more-times\" title=\"Anchor for Match one or more times (&lt;code&gt;+&lt;\/code&gt;)\">#<\/a><\/h3>\n\n\n\n<p>The <code>+<\/code> quantifier matches its preceding element one or more times. For example, the <code>\\d+<\/code> matches one or more digits.<\/p>\n\n\n\n<p>The following example uses the <code>+<\/code> quantifier to match one or more digits in a string:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> re\n\ns = <span class=\"hljs-string\">\"Python 3.10 was released in 2021\"<\/span>\n\nmatches = re.finditer(<span class=\"hljs-string\">'\\d+'<\/span>, s)\n\n<span class=\"hljs-keyword\">for<\/span> match <span class=\"hljs-keyword\">in<\/span> matches:\n    print(match)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">&lt;re.Match object; span=(<span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">8<\/span>), match=<span class=\"hljs-string\">'3'<\/span>&gt;\n&lt;re.Match object; span=(<span class=\"hljs-number\">9<\/span>, <span class=\"hljs-number\">11<\/span>), match=<span class=\"hljs-string\">'10'<\/span>&gt;   \n&lt;re.Match object; span=(<span class=\"hljs-number\">28<\/span>, <span class=\"hljs-number\">32<\/span>), match=<span class=\"hljs-string\">'2021'<\/span>&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='match-zero-or-one-time'>Match zero or one time (?) <a href=\"#match-zero-or-one-time\" class=\"anchor\" id=\"match-zero-or-one-time\" title=\"Anchor for Match zero or one time (&lt;code&gt;?&lt;\/code&gt;)\">#<\/a><\/h3>\n\n\n\n<p>The <code>?<\/code> quantifier matches its preceding element zero or one time.<\/p>\n\n\n\n<p>The following example uses the (?) quantifier to match both strings <code>color<\/code> and <code>colour<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> re\n\ns = <span class=\"hljs-string\">\"What color \/ colour do you like?\"<\/span>\n\nmatches = re.finditer(<span class=\"hljs-string\">'colou?r'<\/span>, s)\n\n<span class=\"hljs-keyword\">for<\/span> match <span class=\"hljs-keyword\">in<\/span> matches:\n    print(match)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">&lt;re.Match object; span=(<span class=\"hljs-number\">5<\/span>, <span class=\"hljs-number\">10<\/span>), match=<span class=\"hljs-string\">'color'<\/span>&gt;\n&lt;re.Match object; span=(<span class=\"hljs-number\">13<\/span>, <span class=\"hljs-number\">19<\/span>), match=<span class=\"hljs-string\">'colour'<\/span>&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, the <code>u?<\/code> matches zero or one character <code>u<\/code>. Therefore, the <code>colou?r<\/code> pattern matches both <code>color<\/code> and <code>colour<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='match-exactly-n-times-n'>Match Exactly n Times: {n} <a href=\"#match-exactly-n-times-n\" class=\"anchor\" id=\"match-exactly-n-times-n\" title=\"Anchor for Match Exactly n Times: {n}\">#<\/a><\/h3>\n\n\n\n<p>The <code>{n}<\/code> quantifier matches its preceding element exactly <code>n<\/code> times, where <code>n<\/code> is zero or a positive integer.<\/p>\n\n\n\n<p>For example, the following program uses the quantifier <code>{n}<\/code> to match a time string in the <code>hh:mm<\/code> format:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> re\n\ns = <span class=\"hljs-string\">\"It was 11:05 AM\"<\/span>\n\nmatches = re.finditer(<span class=\"hljs-string\">'\\d{2}:\\d{2}'<\/span>, s)\n\n<span class=\"hljs-keyword\">for<\/span> match <span class=\"hljs-keyword\">in<\/span> matches:\n    print(match)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">&lt;re.Match object; span=(<span class=\"hljs-number\">7<\/span>, <span class=\"hljs-number\">12<\/span>), match=<span class=\"hljs-string\">'11:05'<\/span>&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, the <code>\\d{2}<\/code> matches exactly two digits. Therefore, the <code>\\d{2}:\\d{2}<\/code> matches a string that starts with two digits, a colon <code>:<\/code>, and ends with two digits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='match-at-least-n-times-n'>Match at least n times: {n,} <a href=\"#match-at-least-n-times-n\" class=\"anchor\" id=\"match-at-least-n-times-n\" title=\"Anchor for Match at least n times: {n,}\">#<\/a><\/h3>\n\n\n\n<p>The <code>{n,}<\/code> quantifier matches its preceding element at least <code>n<\/code> times, where <code>n<\/code> is zero or a positive integer.<\/p>\n\n\n\n<p>For example, the following program uses the <code>{n, }<\/code> quantifier to match the date strings with the <code>m-d-yyyy<\/code> or <code>mm-dd-yyyy<\/code> format:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> re\n\ns = <span class=\"hljs-string\">\"5-5-2021 or 05-05-2021 or 5\/5\/2021\"<\/span>\n\nmatches = re.finditer(<span class=\"hljs-string\">'\\d{1,}-\\d{1,}-\\d{4}'<\/span>, s)\n\n<span class=\"hljs-keyword\">for<\/span> match <span class=\"hljs-keyword\">in<\/span> matches:\n    print(match)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">&lt;re.Match object; span=(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">8<\/span>), match=<span class=\"hljs-string\">'5-5-2021'<\/span>&gt;\n&lt;re.Match object; span=(<span class=\"hljs-number\">12<\/span>, <span class=\"hljs-number\">22<\/span>), match=<span class=\"hljs-string\">'05-05-2021'<\/span>&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='match-from-n-and-m-times-nm'>Match from n and m times: {n,m} <a href=\"#match-from-n-and-m-times-nm\" class=\"anchor\" id=\"match-from-n-and-m-times-nm\" title=\"Anchor for Match from n and m times: {n,m}\">#<\/a><\/h3>\n\n\n\n<p>The <code>{n,m}<\/code> quantifier matches its preceding element at least <code>n<\/code> times, but no more than <code>m<\/code> times, where <code>n<\/code> and <code>m<\/code> are zero or a positive integer. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> re\n\ns = <span class=\"hljs-string\">\"5-5-2021 or 05-05-2021 or 5\/5\/2021\"<\/span>\n\nmatches = re.finditer(<span class=\"hljs-string\">'\\d{1,2}-\\d{1,2}-\\d{4}'<\/span>, s)\n\n<span class=\"hljs-keyword\">for<\/span> match <span class=\"hljs-keyword\">in<\/span> matches:\n    print(match)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">&lt;re.Match object; span=(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">8<\/span>), match=<span class=\"hljs-string\">'5-5-2021'<\/span>&gt;\n&lt;re.Match object; span=(<span class=\"hljs-number\">12<\/span>, <span class=\"hljs-number\">22<\/span>), match=<span class=\"hljs-string\">'05-05-2021'<\/span>&gt;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, the pattern <code>\\d{1,2}<\/code> matches one or two digits. So the pattern <code>\\d{1,2}-\\d{1,2}-\\d{4}<\/code> matches a date string in the <code>d-m-yyyy<\/code> or <code>dd-mm-yyyy<\/code> format.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Quantifiers match their preceding elements a number of times. <\/li><\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"3156\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/python-regex\/python-regex-quantifiers\/\"\n\t\t\t\tdata-post-title=\"Python Regex Quantifiers\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"3156\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/python-regex\/python-regex-quantifiers\/\"\n\t\t\t\tdata-post-title=\"Python Regex Quantifiers\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to use Python regex quantifiers to define how many times a character or a character set can be repeated.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3122,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3156","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/3156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=3156"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/3156\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/3122"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=3156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}