[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573009-105":53,"doc-detail-573009-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","regular-expression-cheat-sheet-reference","Regular Expression Cheat Sheet - Reference","","Regular expression cheat sheet explaining how pattern matching works in strings, including anchors for start/end (^, $), wildcard matching (.), and straightforward literal matches. Covers counting quantifiers such as *, +, ?, and {n,m} to control repetitions, with concrete examples demonstrating what will and will not match. Includes character classes, grouping, alternatives, negated classes, and escaping rules using backslashes with r-prefixed raw strings in Python or the shell.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":51,"@type":70,"position":76},"https://docshare.wps.com/template/general/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/regular-expression-cheat-sheet-reference/573009/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/regular-expression-cheat-sheet-reference/573009.png","ImageObject",442,249,{"name":88,"@type":89},"dbqoiu","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-20","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",6,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"What do the anchors ^ and $ do in regular expressions?","Question",{"text":109,"@type":110},"^ matches the invisible character at the beginning of a string, and $ matches the invisible character at the end. Together they restrict matches to exact positions at the start and end.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How do quantifiers like *, +, ? and {n,m} change matching behavior?",{"text":114,"@type":110},"* allows any number of repeated occurrences, + requires at least one, and ? makes the preceding character optional. {n,m} matches a range from n to m inclusive, while {m} limits the maximum to m.",{"name":116,"@type":107,"acceptedAnswer":117},"What’s the difference between character classes, groups, and alternation?",{"text":118,"@type":110},"A character class like [bar] matches any one of the listed characters. A group like (foo) matches the whole string foo. Alternation like (foo | bar) matches either foo or bar.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},573009,1792107659,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":50,"category_name":51,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":9},3985747862462,"https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2","Regular expression cheat sheet:  \nA regular expression tries to match its characters with any sequence of characters somewhere in another string. There are a lot of special commands used inside of regular expressions, for which this sheet can be a reference.  \nNote: When you see “C” or “A”, assume that “C” and “A” can be replaced with any character. When you see “foo” or “bar”, assume that these can be replaced with arbitrary strings of characters.  \nMatching:  \n“C” matches with the character “C”“.” matches with any other character  \n“^” matches the invisible character at the beginning of a string  \n“$” matches the invisible character at the end of a string.  \nExamples:  \n“^Phil$” matches with “Phil” but not with “PPhil”  \n“Phil” matches with “aaaaaaaPhilaaa”  \n“Carrie” does not match with “Alex”  \n“^CA .GA .$” matches with “CATGAG”  \n“ca .t” does not match with “CAT”  \nCounting:  \n“C*” matches with any number of occurrences ofthe character “C” in a row.  \n“C+” matches with at least one occurrence of the character “C” in a row.  \n“C{n,m}” matches between n and m occurrences of “C” in a row, inclusive.  \n“C{m}” matches at most m occurrences ofthe character “C” in a row.  \n“C?” mean that “C” is optional. It is equivalent to the regular expression “C{0,1}”  \nExamples:  \n“R*i*c*h*$” matches with “qqqRRRRRRiihhhhhhh”  \n“^K*e*s*d*e*n+” matches with “nP”  \n“^151{2}00?$” matches with “15110”  \n“^151{3,7}0$” does not match with “15110”  \nGrouping:  \n“[bar]” creates an equivalence class of characters “b” “a” and “r” It will match with any of them.“(foo)” creates a group of characters. It will only match with the string “foo”  \n“[A-C]” matches everything between “A” and “C”.  \n“[^bar]” matches with everything except for the letters “b” “a” and “r”.  \n“(foo |bar)” matches with either “foo” or “bar”.  \nAll the signs associated with counting characters can also be placed after equivalence classes and groups.  \nExamples:  \n“[abc][a-c][stu]” matches with “cat”.  \n“(Alex |Carrie | Phil |Rich)” matches with “Phil”.  \n“[Rr]{8}iI(ch | SH)?(ch | SH)?” matches with “RrrRiIch”.  \n“[^a-z]*” will never match with any word made up of only lower case letters.  \nEscaping:  \nIf you want to use a character that is otherwise reserved for some special regular expression command, you can put a backslash (“\\”) in front ofit. This is called an escape character. Since python and the shell both will have confusing behavior when dealing with escape characters, if you want to use them put the character r before the string.  \nExample:  \nr”R\\*ich” matches with “R*ich” but not with “RRRRRRich”.","cbCail6KKHsqDUD8","https://ap.wps.com/l/cbCail6KKHsqDUD8","pdf",68390,"English","# Matching\n# Counting\n# Grouping\n# Escaping","[{\"question\":\"What do the anchors ^ and $ do in regular expressions?\",\"answer\":\"^ matches the invisible character at the beginning of a string, and $ matches the invisible character at the end. Together they restrict matches to exact positions at the start and end.\"},{\"question\":\"How do quantifiers like *, +, ? and {n,m} change matching behavior?\",\"answer\":\"* allows any number of repeated occurrences, + requires at least one, and ? makes the preceding character optional. {n,m} matches a range from n to m inclusive, while {m} limits the maximum to m.\"},{\"question\":\"What’s the difference between character classes, groups, and alternation?\",\"answer\":\"A character class like [bar] matches any one of the listed characters. A group like (foo) matches the whole string foo. Alternation like (foo | bar) matches either foo or bar.\"}]","Regular Expression Cheat Sheet - Reference | PDF",1791930620]