[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-726273-105":59,"doc-detail-726273-en":130,"doc-similar-726273":159},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","regular-expressions-intro-to-patterns-and-syntax","Regular Expressions - Intro to Patterns and Syntax","","Regular Expressions explains regular-language patterns for working with text: detecting whether a substring exists, searching and replacing characters within strings, and expanding into deeper study (e.g., CMSC330). It introduces basic regex syntax using delimiters like /abc/ (and notes language differences such as Java), highlights the need to escape special characters, and demonstrates matching behavior with examples. The material covers anchors for start/end of line (^ and $), warnings about whitespace counting, and character sets including ranges and built-in classes such as word boundaries and digit/whitespace tokens.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/regular-expressions-intro-to-patterns-and-syntax/726273/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/regular-expressions-intro-to-patterns-and-syntax/726273.png","ImageObject",300,407,{"name":92,"@type":93},"kopisore","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-25","2026-11-20",true,{"@type":102,"interactionType":103,"userInteractionCount":14},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What are regular expressions used for?","Question",{"text":112,"@type":113},"They describe patterns in text and help check whether a substring exists, as well as search/replace characters in strings.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do ^ and $ affect matching?",{"text":117,"@type":113},"^ matches the start of a line and $ matches the end, so the pattern only matches the exact text between those anchors.",{"name":119,"@type":110,"acceptedAnswer":120},"What is the difference between character sets like [bcd] and negated sets?",{"text":121,"@type":113},"[bcd] matches exactly one character from b, c, or d, while a negated set matches anything except the listed characters.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},726273,1795211900,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":14,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":36,"preview_page_count":19,"preview_urls":144},962090880963,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","Regular Expressions  \n. . .  \nWhat is it?  \n- describes a pattern in text  \n- uses:  \n- check if a certain (sub)string exists  \n- search/replace characters in a string  \n- CMSC330 goes more in depth  \n-  [https://regexr.com/](https://regexr.com/ can be useful)[ can be useful](https://regexr.com/ can be useful)  \nBasic RegEx Syntax  \n/abc/  \n- In some languages, regular expressions are enclosed, in ‘ / ’ or like this r“abc”  \n- Not in Java  \n- Special characters like “\\” must be escaped  \n- A guide on this: [https://www.baeldung.com/java-regexp-escape-char](https://www.baeldung.com/java-regexp-escape-char)  \n- the above matches:  \n- ”abc”,”abcdef”,“defabc”,“.=abc== .=”  \n- but doesn’t match:  \n- “cba”,“fedcba”,“aBc”  \nStart/End of line  \n/ ^ abc$/  \n- ^ : start of line  \n- $ : end of line  \n- the above ONLY matches “abc”  \n- and doesn’t match anything else  \n- exercise: how can I match “apple” but not “apples”?  \nWarning! Every character counts  \n- / s/ is NOT the same as / s/  \n- the first matches ONE space and then an “s”  \n- the second matches TWO spaces and then an “s”  \nCharacter Sets  \n/ [bcd]art/  \n- [] : used to define a character set  \n- the above matches only ONE letter from “b”,“c”,“d”, and then “art”  \n- so it matches: “bart”,“cart”,“dart”  \n- exercise: how can I match “A+”,“B+”,“A-”, and “B-” with ONE RegEx?  \nCharacter Sets (continued, negated)  \n/ [ ^ abc]/  \n- ^ : when used initially inside a character set, negates it  \n- the above matches anything BUT “a”,“b”, or “c”  \n- so it matches ONLY the “g” in “agbc”  \n- NOTE: if used outside a character set, it means start of line  \nCharacter Ranges  \n-  [A-Za-z] matches any letter  \nmatches any character in “apple”,“bAnanA”, and “SUPERstiTION”  \n-  [0-9] matches any digit  \nmatches all in “123”,“092912”, and “2402831608”  \n-  [A-Z0-9] matches any UPPERCASE letter or digit  \nmatches any character in “A1”,“AREA51”, but nothing in “area”  \nBuilt-in Character Ranges  \n- \\b : word boundary (spaces between words)  \n- \\B: non-word boundary (spaces between characters)  \n- \\d: any digit (equivalent to [0-9])  \n- \\D: any non-digit (equivalent to [^0-9])  \n- \\s: any whitespace character (spaces, tabs, newline, etc. )  \n- \\S: any non-whitespace character  \n- \\w: any word (equivalent to [A-Za-z0-9_ ])  \n- \\W: any non-word  \nCharacter Range Examples  \n-  / ^ \\w\\d$/ matches “A1”, “99”, “c6”, “_ 8”  \n-  / ^ \\s\\D$/ matches “ s“(tab),“ 0“(space),““(tab and a space, or vice versa)  \n-  / ^ \\S$/ matches any single character that’s not whitespace  \n-  / ^ \\w\\W$/ matches “A+”,“B-”,“X “(space),“_ /“,“z^”","cbCaic8RYNIUJ28T","https://ap.wps.com/l/cbCaic8RYNIUJ28T","pdf",150188,16,"English","# What is Regular Expressions?\n# Basic RegEx Syntax\n# Start/End of Line\n# Warning: Every Character Counts\n# Character Sets\n# Character Sets (continued, negated)\n# Character Ranges\n## Built-in Character Ranges\n## Character Range Examples","[{\"question\":\"What are regular expressions used for?\",\"answer\":\"They describe patterns in text and help check whether a substring exists, as well as search/replace characters in strings.\"},{\"question\":\"How do ^ and $ affect matching?\",\"answer\":\"^ matches the start of a line and $ matches the end, so the pattern only matches the exact text between those anchors.\"},{\"question\":\"What is the difference between character sets like [bcd] and negated sets?\",\"answer\":\"[bcd] matches exactly one character from b, c, or d, while a negated set matches anything except the listed characters.\"}]","Regular Expressions - Intro to Patterns and Syntax | PDF",[145,149,152,156],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-20/25be1cca8f09d44ba037322f934286fa.webp",983,552,{"page_no":14,"url":150,"width":151,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-20/d72033f5b27f0fca2fc5a8308e92bf22.webp",982,{"page_no":81,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-20/f1743c130c13d603f284b6abd99884ba.webp",981,551,{"page_no":19,"url":157,"width":158,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-20/876815884b592acea9c6a4053e8da40c.webp",980,{"list":160,"token":66},[161,167,173,179,185,192,198,204,211,218],{"doc_id":162,"doc_title":163,"file_type":137,"home_preview_img_url":164,"slug":165,"view_count":81,"category_name":30,"create_tm":166},701030,"Regular Expressions - Quick Reference Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011576998/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=%2FnrHKC7gfn59QY%2Frbo8fbD9kbf8%3D","regular-expressions-quick-reference-guide",1794522969,{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":81,"category_name":30,"create_tm":172},701031,"Regular Expressions: The Complete Tutorial","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011577006/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=BzNX2mex%2B08CZTXZe6hC%2FvhkjN4%3D","regular-expressions-the-complete-tutorial",1794522972,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":46,"category_name":30,"create_tm":178},347081,"Java - Programming - Ninth Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910997878/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=9kSlEvYrWJz6XlRJFjR5LA%2BbNTQ%3D","java-programming-ninth-edition",1790065180,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":19,"category_name":30,"create_tm":184},701037,"Regular Expressions - Chapter 11 - Python for Everybody","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012047384/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=NERsh5%2FIWk%2BmG4xHqN2Oj0giuM0%3D","regular-expressions-chapter-11-python-for-everybody",1794522981,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":190,"category_name":30,"create_tm":191},347082,"Introduction to Programming Using Java - Version 7.0 - Programming basics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911269084/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=PYPRNLxhPI5oP4pQPIgSEXcLM00%3D","introduction-to-programming-using-java-version-70-programming-basics",13,1790065183,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":139,"category_name":30,"create_tm":197},289331,"Specifying Data - Chapter 9 - AMPL","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229902996595/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=mS7sQOh99wr%2FIc8VzR4KFGBWRnU%3D","specifying-data-chapter-9-ampl",1789634992,{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":56,"category_name":30,"create_tm":203},137728,"Jinx Tutorial - Getting Started","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229863058740/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=tniV7LphRA2bhf6AzN9H5x0SJLw%3D","jinx-tutorial-getting-started",1787439582,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":209,"category_name":30,"create_tm":210},347076,"Core Java - Volume 1 - Twelfth Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910997667/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=9WWerE7Tdrxr8yuCQc2ZeDULOY0%3D","core-java-volume-1-twelfth-edition",31,1790065168,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":216,"category_name":30,"create_tm":217},82353,"Practical Source Code Recovery from Binary Functions Using Anchor-Based Retrieval and LLM Reasoning","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808886761/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=FzjuKd8ahHkrGp06U0bfhbkUKQM%3D","practical-source-code-recovery-from-binary-functions-using-anchor-based-retrieval-and-llm-reasoning",32,1784179830,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":223,"category_name":30,"create_tm":224},311712,"AP Computer Science A - Java Quick Reference - Exam Reference Information","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229907590499/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=3sUOaHhPMjLrr5E2wB%2BV7elbQEI%3D","ap-computer-science-a-java-quick-reference-exam-reference-information",14,1789894691]