[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573004-105":53,"doc-detail-573004-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","python-regular-expressions-cheat-sheet","Python Regular Expressions - Cheat Sheet","","Python Regular Expressions Cheat Sheet provides a compact reference for key regex syntax elements, including special characters, anchors, wildcards, quantifiers, alternation, grouping, character classes, and sets. It summarizes common constructs such as \\d, \\s, word boundaries, lookahead and lookbehind assertions, named groups, non-capturing groups, comments, and backreferences. It also lists popular re module functions like findall, search, split, and sub for practical pattern matching and text transformation.",{"@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/python-regular-expressions-cheat-sheet/573004/",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/python-regular-expressions-cheat-sheet/573004.png","ImageObject",442,249,{"name":88,"@type":89},"asda1da","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 ^ and $ mean in Python regular expressions?","Question",{"text":109,"@type":110},"^ matches the expression at the start of a string, and $ matches at the end of a string (before the string terminator).","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How do lookahead and lookbehind assertions work here?",{"text":114,"@type":110},"Lookahead matches based on what follows (A(?=B) for positive, A(?!B) for negative). Lookbehind matches based on what appears immediately to the left ((?\u003C=B)A and (?\u003C!B)A), with fixed-length constraints noted for lookbehind.",{"name":116,"@type":107,"acceptedAnswer":117},"Which Python re functions are commonly used for matching and replacement?",{"text":118,"@type":110},"The sheet highlights re.findall(A, B) for all matches, re.search(A, B) for the first match as an object, re.split(A, B) for splitting by a delimiter, and re.sub(A, B, C) for replacing occurrences in C.","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},573004,1792084510,{"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":9,"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":4},3985747861852,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","LEARN DATA SCIENCE ONLINE Start Learning For [Free -](Free - www.dataquest.io)[ www.dataquest.io](Free - www.dataquest.io)  \nData Science Cheat Sheet  \n\n| SPECIAL CHARACTERS\u003Cbr>^ | Matches the expression to its right at the start of a string. It matches every such instance before each \\n in the string. |\n| --- |\n| $ | Matches the expression to its left at the end of a string. It matches every such instance before each \\n in the string. |\n| . | Matches any character except line terminators like \\n. |\n| \\ | Escapes special characters or denotes character classes. |\n| A|B | Matches expression A or B. If A is matched first, B is left untried. |\n| + | Greedily matches the expression to its left 1 or more times. |\n| * | Greedily matches the expression to its left 0 or more times. |\n| ? | Greedily matches the expression to its left 0 or 1 times. But if ? is added to qualifiers\u003Cbr>(+, *, and ? itself) it will perform matches ina non-greedy manner. |\n| {m} | Matches the expression to its left m times, and not less. |\n| {m,n} | Matches the expression to its left m ton times, and not less. |\n| {m,n}? | Matches the expression to its left m times, and ignores n. See ? above. |\n| CHARACTER CLASSES\u003Cbr>( A. K. A. SPECIAL SEQUENCES )\u003Cbr>\\w | Matches alphanumeric characters, which means a-z, A-Z, and 0-9. It also matches the underscore, _ . |\n| \\d | Matches digits, which means 0-9. |\n| \\D | Matches any non-digits. |\n| \\s | Matches whitespace characters, which include the \\t, \\n, \\r, and space characters. |\n| \\S | Matches non-whitespace characters. |\n| \\b | Matches the boundary (or empty string) at the start and end of a word, that is, between \\w and \\W. |\n| \\B | Matches where \\b does not, that is, the boundary of \\w characters. |\n\n\\A | Matches the expression to its right at the absolute start of a string whether in single or multi-line mode.  \n\n| \\Z | Matches the expression to its left at the absolute end of a string whether in single or multi-line mode. |\n| --- |\n| SETS\u003Cbr>[ ] | Contains a set of characters to match. |\n| [amk] | Matches either a, m, or k. It does not match amk. |\n| [a-z] | Matches any alphabet from a to z. |\n| [a\\-z] | Matches a, - , or z. It matchesbecause \\ escapes it. |\n| [a-] | Matches a or- , because-is not being\u003Cbr>used to indicate a series of characters. |\n| [-a] | As above, matches a or- . |\n| [a-z0-9] | Matches characters from a to zand also from 0 to 9. |\n| [(+*)] | Special characters become literal inside a set, so this matches (, +, *, and ) . |\n\n[^ab5] | Adding ^ excludes any character in the set. Here, it matches characters that are not a, b, or 5.  \n\n| GROUPS\u003Cbr>( ) | Matches the expression inside the parentheses and groups it. |\n| --- |\n| (?) | Inside parentheses like this, ? acts as an extension notation. Its meaning depends on the character immediately to its right. |\n| (?PAB) | Matches the expression AB, and it can be accessed with the group name. |\n| (?aiLmsux) | Here, a, i, L, m, s, u, and x are flags:\u003Cbr>a—Matches ASCII only i—Ignore case\u003Cbr>L—Locale dependent m—Multi-line\u003Cbr>s—Matches all\u003Cbr>u—Matches unicode x—Verbose |\n\nPython Regular Expressions  \n(?:A) | Matches the expression as represented by A, but unlike (?PAB), it cannot be retrieved afterwards.  \n\n| (?\\#...) | A comment. Contents are for us to read, not for matching. |\n| --- |\n| A(?=B) | Lookahead assertion. This matches the expression A only if it is followed by B. |\n| A(?!B) | Negative lookahead assertion. This matches the expression A only if it is not followed by B. |\n| (?\u003C=B)A | Positive lookbehind assertion. This matches the expression A only if Bis immediately to its left. This can only matched fixed length expressions. |\n| (?\u003C!B)A | Negative lookbehind assertion. This matches the expression A only if B isnot immediately to its left. This can only matched fixed length expressions. |\n| (?P=name) | Matches the expression matched by an earlier group named “name”. |\n\n(...)\\1 | The number 1 corresponds to the first group to be matched. If we ","cbCaipKCfS5l4Dty","https://ap.wps.com/l/cbCaipKCfS5l4Dty","pdf",50165,"English","# Special characters\n## Anchors, wildcards, and qualifiers\n# Character classes and sets\n## Groups and extensions\n# Lookarounds and backreferences\n# re module functions","[{\"question\":\"What do ^ and $ mean in Python regular expressions?\",\"answer\":\"^ matches the expression at the start of a string, and $ matches at the end of a string (before the string terminator).\"},{\"question\":\"How do lookahead and lookbehind assertions work here?\",\"answer\":\"Lookahead matches based on what follows (A(?=B) for positive, A(?!B) for negative). Lookbehind matches based on what appears immediately to the left ((?\\u003c=B)A and (?\\u003c!B)A), with fixed-length constraints noted for lookbehind.\"},{\"question\":\"Which Python re functions are commonly used for matching and replacement?\",\"answer\":\"The sheet highlights re.findall(A, B) for all matches, re.search(A, B) for the first match as an object, re.split(A, B) for splitting by a delimiter, and re.sub(A, B, C) for replacing occurrences in C.\"}]","Python Regular Expressions - Cheat Sheet | PDF",1791930612]