[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573006-105":53,"doc-detail-573006-en":126},{"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":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","python-regex-cheatsheet-quick-reference-for-python-27-regular-expressions","python-regex-cheatsheet - quick reference for Python 2.7 regular expressions","","Concise cheat sheet for Python 2.7 regular expressions, summarizing core matching rules and common regex constructs. Covers literals vs special characters, anchors (^, $, \\A, \\Z), character classes ([], ranges, negation), alternation (R|S), and capture groups with precedence. Includes quantifiers ({m},{m,n},*,+,?) and special sequences for digits, whitespace, word boundaries, and non-word matches. Provides escaping guidance, backreferences via named/numbered groups (\\g\u003Cid>), extended regex syntax (lookahead/lookbehind, comments, conditionals, named groups), re.compile flags, and the primary re module functions with MatchObject/RegexObject methods.",{"@graph":63,"@context":118},[64,80,101],{"@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":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/python-regex-cheatsheet-quick-reference-for-python-27-regular-expressions/573006/",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-regex-cheatsheet-quick-reference-for-python-27-regular-expressions/573006.png","ImageObject",442,249,{"name":88,"@type":89},"adawds","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-19","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":47},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How do I escape special characters in Python regular expressions?","Question",{"text":108,"@type":109},"Use a backslash to escape special characters, or start a sequence with \\ to treat the next character appropriately. The cheat sheet notes that regex escapes behave similarly to Python string literal escapes.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"What do ^, $, and re.MULTILINE change in matching behavior?",{"text":113,"@type":109},"^ matches the start of the string, and $ matches the end of the string. With re.MULTILINE, these anchors apply in multiline contexts as specified in the sheet.",{"name":115,"@type":106,"acceptedAnswer":116},"Which functions are available in the Python re module for finding matches?",{"text":117,"@type":109},"The sheet lists compile, match, search, findall, finditer, split, sub, subn, and escape, along with methods on RegexObject such as .match, .search, .findall, and .finditer.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},573006,1792337872,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":47,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":9,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":4},3985747872983,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","Python 2.7 Regular Expressions  \nNon-special chars match themselves. Exceptions are special characters:  \n\\ Escape special char or start a sequence .  \n. Match any char except newline, see re.DOTALL  \n^ Match start of the string, see re.MULTILINE  \n$ Match end of the string, see re.MULTILINE  \n[] Enclose a set of matchable chars  \nR| S Match either regex R or regex S .  \n() Create capture group, & indicate precedence  \nAfter ' [', enclose a set, the only special chars are:  \n] End the set, if not the 1st char  \n- A range, eg . a-c matches a, b or c  \n^ Negate the set only if it is the 1st char  \nQuantifiers (append ' ?' for non-greedy):  \n{m} Exactly m repetitions  \n{m,n} From m (default 0) to n (default infinity)  \n* 0 or more. Same as {,}  \n+ 1 or more. Same as {1,}  \n? 0 or 1. Same as {,1}  \nSpecial sequences:  \n\\A Start of string  \n\\b Match empty string at word (\\w+) boundary \\B Match empty string not at word boundary \\d Digit  \n\\D Non-digit  \n\\s Whitespace [ \\t\\n\\r\\f\\v], see LOCALE,UNICODE \\S Non-whitespace  \n\\w Alphanumeric: [0-9a-zA-Z_ ], see LOCALE \\W Non-alphanumeric  \n\\Z End of string  \n\\g\u003C id> Match prev named or numbered group,' \u003C ' & ' > ' are literal, e .g . \\g\u003C0> or \\g\u003Cname> (not \\g0 or \\gname)  \nSpecial character escapes are much like those already escaped in Python string literals. Hence regex ' \\n' is same as regex ' \\\\n':  \n\\a ASCII Bell (BEL)  \n\\f ASCII Formfeed \\n ASCII Linefeed  \n\\r ASCII Carriage return  \n\\t ASCII Tab  \n\\v ASCII Vertical tab \\\\ A single backslash  \n\\xHH Two digit hexadecimal character goes here \\OOO Three digit octal char (or just use an  \ninitial zero, e.g . \\0, \\09)\\DD Decimal number 1 to 99, match  \nprevious numbered group  \nExtensions. Do not cause grouping, except 'P\u003Cname>':  \n(?iLmsux) Match empty string, sets re.X flags  \n(?: . . . ) Non-capturing version of regular parens  \n(?P\u003Cname> . . . ) Create a named capturing group .  \n(?P=name) Match whatever matched prev named group  \n(?\\# . . . ) A comment; ignored.  \n(?= . . . ) Lookahead assertion, match without consuming  \n(?! . . . ) Negative lookahead assertion  \n(?\u003C= . . . ) Lookbehind assertion, match if preceded  \n(?\u003C ! . . . ) Negative lookbehind assertion  \n(?(id)y | n) Match 'y' if group 'id' matched, else 'n'  \nFlags for re.compile(), etc. Combine with ' | ' :  \nre.I == re.IGNORECASE Ignore case  \nre.L == re.LOCALE Make \\w, \\b, and \\s locale dependent  \nre.M == re.MULTILINE Multiline  \nre.S == re.DOTALL Dot matches all (including newline)  \nre.U == re.UNICODE Make \\w, \\b, \\d, and \\s unicode dependent  \nre.X == re.VERBOSE Verbose (unescaped whitespace in pattern  \nis ignored, and '\\#' marks comment lines)  \nModule level functions:  \ncompile(pattern[, flags]) -> RegexObject match(pattern, string[, flags]) -> MatchObject search(pattner, string[, flags]) -> MatchObject findall(pattern, string[, flags]) -> list of strings  \nfinditer(pattern, string[, flags]) -> iter of MatchObjects split(pattern, string[, maxsplit, flags]) -> list of strings sub(pattern, repl, string[, count, flags]) -> string  \nsubn(pattern, repl, string[, count, flags]) -> (string, int) escape(string) -> string  \npurge() \\# the re cache  \nRegexObjects (returned from compile()):  \n.match(string[, pos, endpos]) -> MatchObject  \n.search(string[, pos, endpos]) -> MatchObject  \n.findall(string[, pos, endpos]) -> list of strings  \n.finditer(string[, pos, endpos]) -> iter of MatchObjects  \n.split(string[, maxsplit]) -> list of strings  \n.sub(repl, string[, count]) -> string  \n.subn(repl, string[, count]) -> (string, int)  \n.flags \\# int, Passed to compile()  \n.groups \\# int, Number of capturing groups  \n.groupindex \\# {}, Maps group names to ints  \n.pattern \\# string, Passed to compile()  \nMatchObjects (returned from match() and search()):  \n.expand(template) -> string, Backslash & group expansion  \n.group([group1 . . . ]) -> string or tuple of strings, 1 per arg  \n.groups([default]) -> tuple of all groups, non-matching=default  \n.groupdict([default]) -> {}, Named gro","cbCaip9N3bWXnTwT","https://ap.wps.com/l/cbCaip9N3bWXnTwT","pdf",13299,"English","# Python 2.7 Regular Expressions\n## Core matching rules and character classes\n## Quantifiers and special sequences\n## Escaping, backreferences, and extended syntax\n## re.compile flags and module-level functions","[{\"question\":\"How do I escape special characters in Python regular expressions?\",\"answer\":\"Use a backslash to escape special characters, or start a sequence with \\\\ to treat the next character appropriately. The cheat sheet notes that regex escapes behave similarly to Python string literal escapes.\"},{\"question\":\"What do ^, $, and re.MULTILINE change in matching behavior?\",\"answer\":\"^ matches the start of the string, and $ matches the end of the string. With re.MULTILINE, these anchors apply in multiline contexts as specified in the sheet.\"},{\"question\":\"Which functions are available in the Python re module for finding matches?\",\"answer\":\"The sheet lists compile, match, search, findall, finditer, split, sub, subn, and escape, along with methods on RegexObject such as .match, .search, .findall, and .finditer.\"}]","python-regex-cheatsheet - quick reference for Python 2.7 regular expressions | PDF",1791930615]