[{"data":1,"prerenderedAt":6808},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/work-regular-expressions":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296,"expanded":13},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361,"expanded":13},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417,"expanded":13},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482,"expanded":13},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20,"expanded":13},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[483],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"body":602,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},{"type":603,"children":604,"toc":6790},"root",[605,614,620,1082,1089,1094,1229,1236,1649,1655,2134,2140,2422,2428,2434,2964,2970,4013,4019,5066,5072,5962,5968,6089,6095,6572,6578,6759,6765,6770,6784],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"working-with-regular-expressions",[611],{"type":612,"value":613},"text","🔍 Working with Regular Expressions",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Regular expressions (regex) are powerful patterns for finding, extracting, and manipulating text. They're essential for data validation, text processing, and extracting information from unstructured data.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","import re\n\n# Basic pattern matching\ntext = \"My email is john@example.com and phone is (555) 123-4567\"\n\n# Find email addresses\nemail_pattern = r'\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b'\nemails = re.findall(email_pattern, text)\n\n# Find phone numbers\nphone_pattern = r'\\(\\d{3}\\) \\d{3}-\\d{4}'\nphones = re.findall(phone_pattern, text)\n\nprint(f\"Found emails: {emails}\")\nprint(f\"Found phones: {phones}\")\n\n# Check if text matches pattern\nis_valid_email = re.match(email_pattern, \"user@domain.com\")\nprint(f\"Valid email: {is_valid_email is not None}\")\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,652,660,669,688,695,703,777,794,802,810,877,894,901,949,990,997,1005,1031],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640,646],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[644],{"type":612,"value":645},"import",{"type":606,"tag":636,"props":647,"children":649},{"style":648},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[650],{"type":612,"value":651}," re\n",{"type":606,"tag":636,"props":653,"children":654},{"class":638,"line":27},[655],{"type":606,"tag":636,"props":656,"children":657},{"emptyLinePlaceholder":13},[658],{"type":612,"value":659},"\n",{"type":606,"tag":636,"props":661,"children":662},{"class":638,"line":36},[663],{"type":606,"tag":636,"props":664,"children":666},{"style":665},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[667],{"type":612,"value":668},"# Basic pattern matching\n",{"type":606,"tag":636,"props":670,"children":671},{"class":638,"line":45},[672,677,682],{"type":606,"tag":636,"props":673,"children":674},{"style":648},[675],{"type":612,"value":676},"text ",{"type":606,"tag":636,"props":678,"children":679},{"style":642},[680],{"type":612,"value":681},"=",{"type":606,"tag":636,"props":683,"children":685},{"style":684},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[686],{"type":612,"value":687}," \"My email is john@example.com and phone is (555) 123-4567\"\n",{"type":606,"tag":636,"props":689,"children":690},{"class":638,"line":54},[691],{"type":606,"tag":636,"props":692,"children":693},{"emptyLinePlaceholder":13},[694],{"type":612,"value":659},{"type":606,"tag":636,"props":696,"children":697},{"class":638,"line":63},[698],{"type":606,"tag":636,"props":699,"children":700},{"style":665},[701],{"type":612,"value":702},"# Find email addresses\n",{"type":606,"tag":636,"props":704,"children":705},{"class":638,"line":72},[706,711,715,720,725,731,736,742,747,751,757,762,767,772],{"type":606,"tag":636,"props":707,"children":708},{"style":648},[709],{"type":612,"value":710},"email_pattern ",{"type":606,"tag":636,"props":712,"children":713},{"style":642},[714],{"type":612,"value":681},{"type":606,"tag":636,"props":716,"children":717},{"style":642},[718],{"type":612,"value":719}," r",{"type":606,"tag":636,"props":721,"children":722},{"style":684},[723],{"type":612,"value":724},"'",{"type":606,"tag":636,"props":726,"children":728},{"style":727},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[729],{"type":612,"value":730},"\\b[A-Za-z0-9._%+-]",{"type":606,"tag":636,"props":732,"children":733},{"style":642},[734],{"type":612,"value":735},"+",{"type":606,"tag":636,"props":737,"children":739},{"style":738},"--shiki-default:#032F62;--shiki-app-dark-mode:#DBEDFF",[740],{"type":612,"value":741},"@",{"type":606,"tag":636,"props":743,"children":744},{"style":727},[745],{"type":612,"value":746},"[A-Za-z0-9.-]",{"type":606,"tag":636,"props":748,"children":749},{"style":642},[750],{"type":612,"value":735},{"type":606,"tag":636,"props":752,"children":754},{"style":753},"--shiki-default:#22863A;--shiki-default-font-weight:bold;--shiki-app-dark-mode:#85E89D;--shiki-app-dark-mode-font-weight:bold",[755],{"type":612,"value":756},"\\.",{"type":606,"tag":636,"props":758,"children":759},{"style":727},[760],{"type":612,"value":761},"[A-Z|a-z]",{"type":606,"tag":636,"props":763,"children":764},{"style":642},[765],{"type":612,"value":766},"{2,}",{"type":606,"tag":636,"props":768,"children":769},{"style":727},[770],{"type":612,"value":771},"\\b",{"type":606,"tag":636,"props":773,"children":774},{"style":684},[775],{"type":612,"value":776},"'\n",{"type":606,"tag":636,"props":778,"children":779},{"class":638,"line":81},[780,785,789],{"type":606,"tag":636,"props":781,"children":782},{"style":648},[783],{"type":612,"value":784},"emails ",{"type":606,"tag":636,"props":786,"children":787},{"style":642},[788],{"type":612,"value":681},{"type":606,"tag":636,"props":790,"children":791},{"style":648},[792],{"type":612,"value":793}," re.findall(email_pattern, text)\n",{"type":606,"tag":636,"props":795,"children":797},{"class":638,"line":796},9,[798],{"type":606,"tag":636,"props":799,"children":800},{"emptyLinePlaceholder":13},[801],{"type":612,"value":659},{"type":606,"tag":636,"props":803,"children":804},{"class":638,"line":99},[805],{"type":606,"tag":636,"props":806,"children":807},{"style":665},[808],{"type":612,"value":809},"# Find phone numbers\n",{"type":606,"tag":636,"props":811,"children":812},{"class":638,"line":108},[813,818,822,826,830,835,840,845,850,855,859,864,868,873],{"type":606,"tag":636,"props":814,"children":815},{"style":648},[816],{"type":612,"value":817},"phone_pattern ",{"type":606,"tag":636,"props":819,"children":820},{"style":642},[821],{"type":612,"value":681},{"type":606,"tag":636,"props":823,"children":824},{"style":642},[825],{"type":612,"value":719},{"type":606,"tag":636,"props":827,"children":828},{"style":684},[829],{"type":612,"value":724},{"type":606,"tag":636,"props":831,"children":832},{"style":753},[833],{"type":612,"value":834},"\\(",{"type":606,"tag":636,"props":836,"children":837},{"style":727},[838],{"type":612,"value":839},"\\d",{"type":606,"tag":636,"props":841,"children":842},{"style":642},[843],{"type":612,"value":844},"{3}",{"type":606,"tag":636,"props":846,"children":847},{"style":753},[848],{"type":612,"value":849},"\\)",{"type":606,"tag":636,"props":851,"children":852},{"style":727},[853],{"type":612,"value":854}," \\d",{"type":606,"tag":636,"props":856,"children":857},{"style":642},[858],{"type":612,"value":844},{"type":606,"tag":636,"props":860,"children":861},{"style":738},[862],{"type":612,"value":863},"-",{"type":606,"tag":636,"props":865,"children":866},{"style":727},[867],{"type":612,"value":839},{"type":606,"tag":636,"props":869,"children":870},{"style":642},[871],{"type":612,"value":872},"{4}",{"type":606,"tag":636,"props":874,"children":875},{"style":684},[876],{"type":612,"value":776},{"type":606,"tag":636,"props":878,"children":879},{"class":638,"line":117},[880,885,889],{"type":606,"tag":636,"props":881,"children":882},{"style":648},[883],{"type":612,"value":884},"phones ",{"type":606,"tag":636,"props":886,"children":887},{"style":642},[888],{"type":612,"value":681},{"type":606,"tag":636,"props":890,"children":891},{"style":648},[892],{"type":612,"value":893}," re.findall(phone_pattern, text)\n",{"type":606,"tag":636,"props":895,"children":896},{"class":638,"line":126},[897],{"type":606,"tag":636,"props":898,"children":899},{"emptyLinePlaceholder":13},[900],{"type":612,"value":659},{"type":606,"tag":636,"props":902,"children":903},{"class":638,"line":135},[904,909,914,919,924,929,934,939,944],{"type":606,"tag":636,"props":905,"children":906},{"style":727},[907],{"type":612,"value":908},"print",{"type":606,"tag":636,"props":910,"children":911},{"style":648},[912],{"type":612,"value":913},"(",{"type":606,"tag":636,"props":915,"children":916},{"style":642},[917],{"type":612,"value":918},"f",{"type":606,"tag":636,"props":920,"children":921},{"style":684},[922],{"type":612,"value":923},"\"Found emails: ",{"type":606,"tag":636,"props":925,"children":926},{"style":727},[927],{"type":612,"value":928},"{",{"type":606,"tag":636,"props":930,"children":931},{"style":648},[932],{"type":612,"value":933},"emails",{"type":606,"tag":636,"props":935,"children":936},{"style":727},[937],{"type":612,"value":938},"}",{"type":606,"tag":636,"props":940,"children":941},{"style":684},[942],{"type":612,"value":943},"\"",{"type":606,"tag":636,"props":945,"children":946},{"style":648},[947],{"type":612,"value":948},")\n",{"type":606,"tag":636,"props":950,"children":951},{"class":638,"line":144},[952,956,960,964,969,973,978,982,986],{"type":606,"tag":636,"props":953,"children":954},{"style":727},[955],{"type":612,"value":908},{"type":606,"tag":636,"props":957,"children":958},{"style":648},[959],{"type":612,"value":913},{"type":606,"tag":636,"props":961,"children":962},{"style":642},[963],{"type":612,"value":918},{"type":606,"tag":636,"props":965,"children":966},{"style":684},[967],{"type":612,"value":968},"\"Found phones: ",{"type":606,"tag":636,"props":970,"children":971},{"style":727},[972],{"type":612,"value":928},{"type":606,"tag":636,"props":974,"children":975},{"style":648},[976],{"type":612,"value":977},"phones",{"type":606,"tag":636,"props":979,"children":980},{"style":727},[981],{"type":612,"value":938},{"type":606,"tag":636,"props":983,"children":984},{"style":684},[985],{"type":612,"value":943},{"type":606,"tag":636,"props":987,"children":988},{"style":648},[989],{"type":612,"value":948},{"type":606,"tag":636,"props":991,"children":992},{"class":638,"line":153},[993],{"type":606,"tag":636,"props":994,"children":995},{"emptyLinePlaceholder":13},[996],{"type":612,"value":659},{"type":606,"tag":636,"props":998,"children":999},{"class":638,"line":163},[1000],{"type":606,"tag":636,"props":1001,"children":1002},{"style":665},[1003],{"type":612,"value":1004},"# Check if text matches pattern\n",{"type":606,"tag":636,"props":1006,"children":1007},{"class":638,"line":172},[1008,1013,1017,1022,1027],{"type":606,"tag":636,"props":1009,"children":1010},{"style":648},[1011],{"type":612,"value":1012},"is_valid_email ",{"type":606,"tag":636,"props":1014,"children":1015},{"style":642},[1016],{"type":612,"value":681},{"type":606,"tag":636,"props":1018,"children":1019},{"style":648},[1020],{"type":612,"value":1021}," re.match(email_pattern, ",{"type":606,"tag":636,"props":1023,"children":1024},{"style":684},[1025],{"type":612,"value":1026},"\"user@domain.com\"",{"type":606,"tag":636,"props":1028,"children":1029},{"style":648},[1030],{"type":612,"value":948},{"type":606,"tag":636,"props":1032,"children":1033},{"class":638,"line":181},[1034,1038,1042,1046,1051,1055,1059,1064,1069,1074,1078],{"type":606,"tag":636,"props":1035,"children":1036},{"style":727},[1037],{"type":612,"value":908},{"type":606,"tag":636,"props":1039,"children":1040},{"style":648},[1041],{"type":612,"value":913},{"type":606,"tag":636,"props":1043,"children":1044},{"style":642},[1045],{"type":612,"value":918},{"type":606,"tag":636,"props":1047,"children":1048},{"style":684},[1049],{"type":612,"value":1050},"\"Valid email: ",{"type":606,"tag":636,"props":1052,"children":1053},{"style":727},[1054],{"type":612,"value":928},{"type":606,"tag":636,"props":1056,"children":1057},{"style":648},[1058],{"type":612,"value":1012},{"type":606,"tag":636,"props":1060,"children":1061},{"style":642},[1062],{"type":612,"value":1063},"is",{"type":606,"tag":636,"props":1065,"children":1066},{"style":642},[1067],{"type":612,"value":1068}," not",{"type":606,"tag":636,"props":1070,"children":1071},{"style":727},[1072],{"type":612,"value":1073}," None}",{"type":606,"tag":636,"props":1075,"children":1076},{"style":684},[1077],{"type":612,"value":943},{"type":606,"tag":636,"props":1079,"children":1080},{"style":648},[1081],{"type":612,"value":948},{"type":606,"tag":1083,"props":1084,"children":1086},"h2",{"id":1085},"understanding-regular-expressions",[1087],{"type":612,"value":1088},"🎯 Understanding Regular Expressions",{"type":606,"tag":615,"props":1090,"children":1091},{},[1092],{"type":612,"value":1093},"Regular expressions use special characters to define search patterns that can match various text combinations.",{"type":606,"tag":1095,"props":1096,"children":1100},"info-box",{"emoji":1097,"title":1098,"type":1099},"🔤","Regex Basics","info",[1101,1110,1135,1143,1166,1182],{"type":606,"tag":615,"props":1102,"children":1103},{},[1104],{"type":606,"tag":1105,"props":1106,"children":1107},"strong",{},[1108],{"type":612,"value":1109},"What Regex Does:",{"type":606,"tag":1111,"props":1112,"children":1113},"ul",{},[1114,1120,1125,1130],{"type":606,"tag":1115,"props":1116,"children":1117},"li",{},[1118],{"type":612,"value":1119},"Find patterns in text",{"type":606,"tag":1115,"props":1121,"children":1122},{},[1123],{"type":612,"value":1124},"Extract specific data",{"type":606,"tag":1115,"props":1126,"children":1127},{},[1128],{"type":612,"value":1129},"Validate input formats",{"type":606,"tag":1115,"props":1131,"children":1132},{},[1133],{"type":612,"value":1134},"Replace text based on patterns",{"type":606,"tag":615,"props":1136,"children":1137},{},[1138],{"type":606,"tag":1105,"props":1139,"children":1140},{},[1141],{"type":612,"value":1142},"Common Use Cases:",{"type":606,"tag":1111,"props":1144,"children":1145},{},[1146,1151,1156,1161],{"type":606,"tag":1115,"props":1147,"children":1148},{},[1149],{"type":612,"value":1150},"Email and phone validation",{"type":606,"tag":1115,"props":1152,"children":1153},{},[1154],{"type":612,"value":1155},"Data extraction from logs",{"type":606,"tag":1115,"props":1157,"children":1158},{},[1159],{"type":612,"value":1160},"Text cleaning and formatting",{"type":606,"tag":1115,"props":1162,"children":1163},{},[1164],{"type":612,"value":1165},"URL and filename parsing",{"type":606,"tag":615,"props":1167,"children":1168},{},[1169],{"type":606,"tag":1105,"props":1170,"children":1171},{},[1172,1174,1180],{"type":612,"value":1173},"Python's ",{"type":606,"tag":632,"props":1175,"children":1177},{"className":1176},[],[1178],{"type":612,"value":1179},"re",{"type":612,"value":1181}," Module:",{"type":606,"tag":1111,"props":1183,"children":1184},{},[1185,1196,1207,1218],{"type":606,"tag":1115,"props":1186,"children":1187},{},[1188,1194],{"type":606,"tag":632,"props":1189,"children":1191},{"className":1190},[],[1192],{"type":612,"value":1193},"re.search()",{"type":612,"value":1195}," - Find first match",{"type":606,"tag":1115,"props":1197,"children":1198},{},[1199,1205],{"type":606,"tag":632,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":612,"value":1204},"re.findall()",{"type":612,"value":1206}," - Find all matches",{"type":606,"tag":1115,"props":1208,"children":1209},{},[1210,1216],{"type":606,"tag":632,"props":1211,"children":1213},{"className":1212},[],[1214],{"type":612,"value":1215},"re.match()",{"type":612,"value":1217}," - Match from start",{"type":606,"tag":1115,"props":1219,"children":1220},{},[1221,1227],{"type":606,"tag":632,"props":1222,"children":1224},{"className":1223},[],[1225],{"type":612,"value":1226},"re.sub()",{"type":612,"value":1228}," - Replace patterns",{"type":606,"tag":1230,"props":1231,"children":1233},"h3",{"id":1232},"basic-pattern-matching",[1234],{"type":612,"value":1235},"Basic Pattern Matching",{"type":606,"tag":621,"props":1237,"children":1238},{},[1239],{"type":606,"tag":625,"props":1240,"children":1242},{"className":627,"code":1241,"language":629,"meta":8,"style":8},"import re\n\ntext = \"The year 2024 was great, better than 2023\"\n\n# Find all 4-digit numbers (years)\nyears = re.findall(r'\\d{4}', text)\nprint(f\"Years found: {years}\")\n\n# Check if text starts with \"The\"\nstarts_with_the = re.match(r'The', text)\nprint(f\"Starts with 'The': {starts_with_the is not None}\")\n\n# Find first occurrence of a year\nfirst_year = re.search(r'\\d{4}', text)\nif first_year:\n    print(f\"First year: {first_year.group()}\")\n    print(f\"Position: {first_year.start()}-{first_year.end()}\")\n",[1243],{"type":606,"tag":632,"props":1244,"children":1245},{"__ignoreMap":8},[1246,1257,1264,1280,1287,1295,1338,1379,1386,1394,1432,1480,1487,1495,1536,1549,1591],{"type":606,"tag":636,"props":1247,"children":1248},{"class":638,"line":12},[1249,1253],{"type":606,"tag":636,"props":1250,"children":1251},{"style":642},[1252],{"type":612,"value":645},{"type":606,"tag":636,"props":1254,"children":1255},{"style":648},[1256],{"type":612,"value":651},{"type":606,"tag":636,"props":1258,"children":1259},{"class":638,"line":27},[1260],{"type":606,"tag":636,"props":1261,"children":1262},{"emptyLinePlaceholder":13},[1263],{"type":612,"value":659},{"type":606,"tag":636,"props":1265,"children":1266},{"class":638,"line":36},[1267,1271,1275],{"type":606,"tag":636,"props":1268,"children":1269},{"style":648},[1270],{"type":612,"value":676},{"type":606,"tag":636,"props":1272,"children":1273},{"style":642},[1274],{"type":612,"value":681},{"type":606,"tag":636,"props":1276,"children":1277},{"style":684},[1278],{"type":612,"value":1279}," \"The year 2024 was great, better than 2023\"\n",{"type":606,"tag":636,"props":1281,"children":1282},{"class":638,"line":45},[1283],{"type":606,"tag":636,"props":1284,"children":1285},{"emptyLinePlaceholder":13},[1286],{"type":612,"value":659},{"type":606,"tag":636,"props":1288,"children":1289},{"class":638,"line":54},[1290],{"type":606,"tag":636,"props":1291,"children":1292},{"style":665},[1293],{"type":612,"value":1294},"# Find all 4-digit numbers (years)\n",{"type":606,"tag":636,"props":1296,"children":1297},{"class":638,"line":63},[1298,1303,1307,1312,1317,1321,1325,1329,1333],{"type":606,"tag":636,"props":1299,"children":1300},{"style":648},[1301],{"type":612,"value":1302},"years ",{"type":606,"tag":636,"props":1304,"children":1305},{"style":642},[1306],{"type":612,"value":681},{"type":606,"tag":636,"props":1308,"children":1309},{"style":648},[1310],{"type":612,"value":1311}," re.findall(",{"type":606,"tag":636,"props":1313,"children":1314},{"style":642},[1315],{"type":612,"value":1316},"r",{"type":606,"tag":636,"props":1318,"children":1319},{"style":684},[1320],{"type":612,"value":724},{"type":606,"tag":636,"props":1322,"children":1323},{"style":727},[1324],{"type":612,"value":839},{"type":606,"tag":636,"props":1326,"children":1327},{"style":642},[1328],{"type":612,"value":872},{"type":606,"tag":636,"props":1330,"children":1331},{"style":684},[1332],{"type":612,"value":724},{"type":606,"tag":636,"props":1334,"children":1335},{"style":648},[1336],{"type":612,"value":1337},", text)\n",{"type":606,"tag":636,"props":1339,"children":1340},{"class":638,"line":72},[1341,1345,1349,1353,1358,1362,1367,1371,1375],{"type":606,"tag":636,"props":1342,"children":1343},{"style":727},[1344],{"type":612,"value":908},{"type":606,"tag":636,"props":1346,"children":1347},{"style":648},[1348],{"type":612,"value":913},{"type":606,"tag":636,"props":1350,"children":1351},{"style":642},[1352],{"type":612,"value":918},{"type":606,"tag":636,"props":1354,"children":1355},{"style":684},[1356],{"type":612,"value":1357},"\"Years found: ",{"type":606,"tag":636,"props":1359,"children":1360},{"style":727},[1361],{"type":612,"value":928},{"type":606,"tag":636,"props":1363,"children":1364},{"style":648},[1365],{"type":612,"value":1366},"years",{"type":606,"tag":636,"props":1368,"children":1369},{"style":727},[1370],{"type":612,"value":938},{"type":606,"tag":636,"props":1372,"children":1373},{"style":684},[1374],{"type":612,"value":943},{"type":606,"tag":636,"props":1376,"children":1377},{"style":648},[1378],{"type":612,"value":948},{"type":606,"tag":636,"props":1380,"children":1381},{"class":638,"line":81},[1382],{"type":606,"tag":636,"props":1383,"children":1384},{"emptyLinePlaceholder":13},[1385],{"type":612,"value":659},{"type":606,"tag":636,"props":1387,"children":1388},{"class":638,"line":796},[1389],{"type":606,"tag":636,"props":1390,"children":1391},{"style":665},[1392],{"type":612,"value":1393},"# Check if text starts with \"The\"\n",{"type":606,"tag":636,"props":1395,"children":1396},{"class":638,"line":99},[1397,1402,1406,1411,1415,1419,1424,1428],{"type":606,"tag":636,"props":1398,"children":1399},{"style":648},[1400],{"type":612,"value":1401},"starts_with_the ",{"type":606,"tag":636,"props":1403,"children":1404},{"style":642},[1405],{"type":612,"value":681},{"type":606,"tag":636,"props":1407,"children":1408},{"style":648},[1409],{"type":612,"value":1410}," re.match(",{"type":606,"tag":636,"props":1412,"children":1413},{"style":642},[1414],{"type":612,"value":1316},{"type":606,"tag":636,"props":1416,"children":1417},{"style":684},[1418],{"type":612,"value":724},{"type":606,"tag":636,"props":1420,"children":1421},{"style":738},[1422],{"type":612,"value":1423},"The",{"type":606,"tag":636,"props":1425,"children":1426},{"style":684},[1427],{"type":612,"value":724},{"type":606,"tag":636,"props":1429,"children":1430},{"style":648},[1431],{"type":612,"value":1337},{"type":606,"tag":636,"props":1433,"children":1434},{"class":638,"line":108},[1435,1439,1443,1447,1452,1456,1460,1464,1468,1472,1476],{"type":606,"tag":636,"props":1436,"children":1437},{"style":727},[1438],{"type":612,"value":908},{"type":606,"tag":636,"props":1440,"children":1441},{"style":648},[1442],{"type":612,"value":913},{"type":606,"tag":636,"props":1444,"children":1445},{"style":642},[1446],{"type":612,"value":918},{"type":606,"tag":636,"props":1448,"children":1449},{"style":684},[1450],{"type":612,"value":1451},"\"Starts with 'The': ",{"type":606,"tag":636,"props":1453,"children":1454},{"style":727},[1455],{"type":612,"value":928},{"type":606,"tag":636,"props":1457,"children":1458},{"style":648},[1459],{"type":612,"value":1401},{"type":606,"tag":636,"props":1461,"children":1462},{"style":642},[1463],{"type":612,"value":1063},{"type":606,"tag":636,"props":1465,"children":1466},{"style":642},[1467],{"type":612,"value":1068},{"type":606,"tag":636,"props":1469,"children":1470},{"style":727},[1471],{"type":612,"value":1073},{"type":606,"tag":636,"props":1473,"children":1474},{"style":684},[1475],{"type":612,"value":943},{"type":606,"tag":636,"props":1477,"children":1478},{"style":648},[1479],{"type":612,"value":948},{"type":606,"tag":636,"props":1481,"children":1482},{"class":638,"line":117},[1483],{"type":606,"tag":636,"props":1484,"children":1485},{"emptyLinePlaceholder":13},[1486],{"type":612,"value":659},{"type":606,"tag":636,"props":1488,"children":1489},{"class":638,"line":126},[1490],{"type":606,"tag":636,"props":1491,"children":1492},{"style":665},[1493],{"type":612,"value":1494},"# Find first occurrence of a year\n",{"type":606,"tag":636,"props":1496,"children":1497},{"class":638,"line":135},[1498,1503,1507,1512,1516,1520,1524,1528,1532],{"type":606,"tag":636,"props":1499,"children":1500},{"style":648},[1501],{"type":612,"value":1502},"first_year ",{"type":606,"tag":636,"props":1504,"children":1505},{"style":642},[1506],{"type":612,"value":681},{"type":606,"tag":636,"props":1508,"children":1509},{"style":648},[1510],{"type":612,"value":1511}," re.search(",{"type":606,"tag":636,"props":1513,"children":1514},{"style":642},[1515],{"type":612,"value":1316},{"type":606,"tag":636,"props":1517,"children":1518},{"style":684},[1519],{"type":612,"value":724},{"type":606,"tag":636,"props":1521,"children":1522},{"style":727},[1523],{"type":612,"value":839},{"type":606,"tag":636,"props":1525,"children":1526},{"style":642},[1527],{"type":612,"value":872},{"type":606,"tag":636,"props":1529,"children":1530},{"style":684},[1531],{"type":612,"value":724},{"type":606,"tag":636,"props":1533,"children":1534},{"style":648},[1535],{"type":612,"value":1337},{"type":606,"tag":636,"props":1537,"children":1538},{"class":638,"line":144},[1539,1544],{"type":606,"tag":636,"props":1540,"children":1541},{"style":642},[1542],{"type":612,"value":1543},"if",{"type":606,"tag":636,"props":1545,"children":1546},{"style":648},[1547],{"type":612,"value":1548}," first_year:\n",{"type":606,"tag":636,"props":1550,"children":1551},{"class":638,"line":153},[1552,1557,1561,1565,1570,1574,1579,1583,1587],{"type":606,"tag":636,"props":1553,"children":1554},{"style":727},[1555],{"type":612,"value":1556},"    print",{"type":606,"tag":636,"props":1558,"children":1559},{"style":648},[1560],{"type":612,"value":913},{"type":606,"tag":636,"props":1562,"children":1563},{"style":642},[1564],{"type":612,"value":918},{"type":606,"tag":636,"props":1566,"children":1567},{"style":684},[1568],{"type":612,"value":1569},"\"First year: ",{"type":606,"tag":636,"props":1571,"children":1572},{"style":727},[1573],{"type":612,"value":928},{"type":606,"tag":636,"props":1575,"children":1576},{"style":648},[1577],{"type":612,"value":1578},"first_year.group()",{"type":606,"tag":636,"props":1580,"children":1581},{"style":727},[1582],{"type":612,"value":938},{"type":606,"tag":636,"props":1584,"children":1585},{"style":684},[1586],{"type":612,"value":943},{"type":606,"tag":636,"props":1588,"children":1589},{"style":648},[1590],{"type":612,"value":948},{"type":606,"tag":636,"props":1592,"children":1593},{"class":638,"line":163},[1594,1598,1602,1606,1611,1615,1620,1624,1628,1632,1637,1641,1645],{"type":606,"tag":636,"props":1595,"children":1596},{"style":727},[1597],{"type":612,"value":1556},{"type":606,"tag":636,"props":1599,"children":1600},{"style":648},[1601],{"type":612,"value":913},{"type":606,"tag":636,"props":1603,"children":1604},{"style":642},[1605],{"type":612,"value":918},{"type":606,"tag":636,"props":1607,"children":1608},{"style":684},[1609],{"type":612,"value":1610},"\"Position: ",{"type":606,"tag":636,"props":1612,"children":1613},{"style":727},[1614],{"type":612,"value":928},{"type":606,"tag":636,"props":1616,"children":1617},{"style":648},[1618],{"type":612,"value":1619},"first_year.start()",{"type":606,"tag":636,"props":1621,"children":1622},{"style":727},[1623],{"type":612,"value":938},{"type":606,"tag":636,"props":1625,"children":1626},{"style":684},[1627],{"type":612,"value":863},{"type":606,"tag":636,"props":1629,"children":1630},{"style":727},[1631],{"type":612,"value":928},{"type":606,"tag":636,"props":1633,"children":1634},{"style":648},[1635],{"type":612,"value":1636},"first_year.end()",{"type":606,"tag":636,"props":1638,"children":1639},{"style":727},[1640],{"type":612,"value":938},{"type":606,"tag":636,"props":1642,"children":1643},{"style":684},[1644],{"type":612,"value":943},{"type":606,"tag":636,"props":1646,"children":1647},{"style":648},[1648],{"type":612,"value":948},{"type":606,"tag":1230,"props":1650,"children":1652},{"id":1651},"text-replacement-with-regex",[1653],{"type":612,"value":1654},"Text Replacement with Regex",{"type":606,"tag":621,"props":1656,"children":1657},{},[1658],{"type":606,"tag":625,"props":1659,"children":1661},{"className":627,"code":1660,"language":629,"meta":8,"style":8},"import re\n\n# Replace patterns in text\ntext = \"Call us at 555-123-4567 or 555-987-6543\"\n\n# Replace phone numbers with masked version\nmasked = re.sub(r'\\d{3}-\\d{3}-\\d{4}', 'XXX-XXX-XXXX', text)\nprint(f\"Masked: {masked}\")\n\n# Replace with capture groups\ntext2 = \"John Smith, Jane Doe, Bob Johnson\"\n# Swap first and last names\nswapped = re.sub(r'(\\w+) (\\w+)', r'\\2, \\1', text2)\nprint(f\"Swapped: {swapped}\")\n\n# Remove extra whitespace\nmessy_text = \"Hello    world   with    spaces\"\ncleaned = re.sub(r'\\s+', ' ', messy_text)\nprint(f\"Cleaned: {cleaned}\")\n",[1662],{"type":606,"tag":632,"props":1663,"children":1664},{"__ignoreMap":8},[1665,1676,1683,1691,1707,1714,1722,1797,1838,1845,1853,1870,1878,1969,2010,2017,2025,2042,2093],{"type":606,"tag":636,"props":1666,"children":1667},{"class":638,"line":12},[1668,1672],{"type":606,"tag":636,"props":1669,"children":1670},{"style":642},[1671],{"type":612,"value":645},{"type":606,"tag":636,"props":1673,"children":1674},{"style":648},[1675],{"type":612,"value":651},{"type":606,"tag":636,"props":1677,"children":1678},{"class":638,"line":27},[1679],{"type":606,"tag":636,"props":1680,"children":1681},{"emptyLinePlaceholder":13},[1682],{"type":612,"value":659},{"type":606,"tag":636,"props":1684,"children":1685},{"class":638,"line":36},[1686],{"type":606,"tag":636,"props":1687,"children":1688},{"style":665},[1689],{"type":612,"value":1690},"# Replace patterns in text\n",{"type":606,"tag":636,"props":1692,"children":1693},{"class":638,"line":45},[1694,1698,1702],{"type":606,"tag":636,"props":1695,"children":1696},{"style":648},[1697],{"type":612,"value":676},{"type":606,"tag":636,"props":1699,"children":1700},{"style":642},[1701],{"type":612,"value":681},{"type":606,"tag":636,"props":1703,"children":1704},{"style":684},[1705],{"type":612,"value":1706}," \"Call us at 555-123-4567 or 555-987-6543\"\n",{"type":606,"tag":636,"props":1708,"children":1709},{"class":638,"line":54},[1710],{"type":606,"tag":636,"props":1711,"children":1712},{"emptyLinePlaceholder":13},[1713],{"type":612,"value":659},{"type":606,"tag":636,"props":1715,"children":1716},{"class":638,"line":63},[1717],{"type":606,"tag":636,"props":1718,"children":1719},{"style":665},[1720],{"type":612,"value":1721},"# Replace phone numbers with masked version\n",{"type":606,"tag":636,"props":1723,"children":1724},{"class":638,"line":72},[1725,1730,1734,1739,1743,1747,1751,1755,1759,1763,1767,1771,1775,1779,1783,1788,1793],{"type":606,"tag":636,"props":1726,"children":1727},{"style":648},[1728],{"type":612,"value":1729},"masked ",{"type":606,"tag":636,"props":1731,"children":1732},{"style":642},[1733],{"type":612,"value":681},{"type":606,"tag":636,"props":1735,"children":1736},{"style":648},[1737],{"type":612,"value":1738}," re.sub(",{"type":606,"tag":636,"props":1740,"children":1741},{"style":642},[1742],{"type":612,"value":1316},{"type":606,"tag":636,"props":1744,"children":1745},{"style":684},[1746],{"type":612,"value":724},{"type":606,"tag":636,"props":1748,"children":1749},{"style":727},[1750],{"type":612,"value":839},{"type":606,"tag":636,"props":1752,"children":1753},{"style":642},[1754],{"type":612,"value":844},{"type":606,"tag":636,"props":1756,"children":1757},{"style":738},[1758],{"type":612,"value":863},{"type":606,"tag":636,"props":1760,"children":1761},{"style":727},[1762],{"type":612,"value":839},{"type":606,"tag":636,"props":1764,"children":1765},{"style":642},[1766],{"type":612,"value":844},{"type":606,"tag":636,"props":1768,"children":1769},{"style":738},[1770],{"type":612,"value":863},{"type":606,"tag":636,"props":1772,"children":1773},{"style":727},[1774],{"type":612,"value":839},{"type":606,"tag":636,"props":1776,"children":1777},{"style":642},[1778],{"type":612,"value":872},{"type":606,"tag":636,"props":1780,"children":1781},{"style":684},[1782],{"type":612,"value":724},{"type":606,"tag":636,"props":1784,"children":1785},{"style":648},[1786],{"type":612,"value":1787},", ",{"type":606,"tag":636,"props":1789,"children":1790},{"style":684},[1791],{"type":612,"value":1792},"'XXX-XXX-XXXX'",{"type":606,"tag":636,"props":1794,"children":1795},{"style":648},[1796],{"type":612,"value":1337},{"type":606,"tag":636,"props":1798,"children":1799},{"class":638,"line":81},[1800,1804,1808,1812,1817,1821,1826,1830,1834],{"type":606,"tag":636,"props":1801,"children":1802},{"style":727},[1803],{"type":612,"value":908},{"type":606,"tag":636,"props":1805,"children":1806},{"style":648},[1807],{"type":612,"value":913},{"type":606,"tag":636,"props":1809,"children":1810},{"style":642},[1811],{"type":612,"value":918},{"type":606,"tag":636,"props":1813,"children":1814},{"style":684},[1815],{"type":612,"value":1816},"\"Masked: ",{"type":606,"tag":636,"props":1818,"children":1819},{"style":727},[1820],{"type":612,"value":928},{"type":606,"tag":636,"props":1822,"children":1823},{"style":648},[1824],{"type":612,"value":1825},"masked",{"type":606,"tag":636,"props":1827,"children":1828},{"style":727},[1829],{"type":612,"value":938},{"type":606,"tag":636,"props":1831,"children":1832},{"style":684},[1833],{"type":612,"value":943},{"type":606,"tag":636,"props":1835,"children":1836},{"style":648},[1837],{"type":612,"value":948},{"type":606,"tag":636,"props":1839,"children":1840},{"class":638,"line":796},[1841],{"type":606,"tag":636,"props":1842,"children":1843},{"emptyLinePlaceholder":13},[1844],{"type":612,"value":659},{"type":606,"tag":636,"props":1846,"children":1847},{"class":638,"line":99},[1848],{"type":606,"tag":636,"props":1849,"children":1850},{"style":665},[1851],{"type":612,"value":1852},"# Replace with capture groups\n",{"type":606,"tag":636,"props":1854,"children":1855},{"class":638,"line":108},[1856,1861,1865],{"type":606,"tag":636,"props":1857,"children":1858},{"style":648},[1859],{"type":612,"value":1860},"text2 ",{"type":606,"tag":636,"props":1862,"children":1863},{"style":642},[1864],{"type":612,"value":681},{"type":606,"tag":636,"props":1866,"children":1867},{"style":684},[1868],{"type":612,"value":1869}," \"John Smith, Jane Doe, Bob Johnson\"\n",{"type":606,"tag":636,"props":1871,"children":1872},{"class":638,"line":117},[1873],{"type":606,"tag":636,"props":1874,"children":1875},{"style":665},[1876],{"type":612,"value":1877},"# Swap first and last names\n",{"type":606,"tag":636,"props":1879,"children":1880},{"class":638,"line":126},[1881,1886,1890,1894,1898,1902,1907,1911,1916,1921,1925,1929,1933,1937,1941,1945,1951,1955,1960,1964],{"type":606,"tag":636,"props":1882,"children":1883},{"style":648},[1884],{"type":612,"value":1885},"swapped ",{"type":606,"tag":636,"props":1887,"children":1888},{"style":642},[1889],{"type":612,"value":681},{"type":606,"tag":636,"props":1891,"children":1892},{"style":648},[1893],{"type":612,"value":1738},{"type":606,"tag":636,"props":1895,"children":1896},{"style":642},[1897],{"type":612,"value":1316},{"type":606,"tag":636,"props":1899,"children":1900},{"style":684},[1901],{"type":612,"value":724},{"type":606,"tag":636,"props":1903,"children":1904},{"style":727},[1905],{"type":612,"value":1906},"(\\w",{"type":606,"tag":636,"props":1908,"children":1909},{"style":642},[1910],{"type":612,"value":735},{"type":606,"tag":636,"props":1912,"children":1913},{"style":727},[1914],{"type":612,"value":1915},")",{"type":606,"tag":636,"props":1917,"children":1918},{"style":727},[1919],{"type":612,"value":1920}," (\\w",{"type":606,"tag":636,"props":1922,"children":1923},{"style":642},[1924],{"type":612,"value":735},{"type":606,"tag":636,"props":1926,"children":1927},{"style":727},[1928],{"type":612,"value":1915},{"type":606,"tag":636,"props":1930,"children":1931},{"style":684},[1932],{"type":612,"value":724},{"type":606,"tag":636,"props":1934,"children":1935},{"style":648},[1936],{"type":612,"value":1787},{"type":606,"tag":636,"props":1938,"children":1939},{"style":642},[1940],{"type":612,"value":1316},{"type":606,"tag":636,"props":1942,"children":1943},{"style":684},[1944],{"type":612,"value":724},{"type":606,"tag":636,"props":1946,"children":1948},{"style":1947},"--shiki-default:#22863A;--shiki-app-dark-mode:#85E89D",[1949],{"type":612,"value":1950},"\\2",{"type":606,"tag":636,"props":1952,"children":1953},{"style":738},[1954],{"type":612,"value":1787},{"type":606,"tag":636,"props":1956,"children":1957},{"style":1947},[1958],{"type":612,"value":1959},"\\1",{"type":606,"tag":636,"props":1961,"children":1962},{"style":684},[1963],{"type":612,"value":724},{"type":606,"tag":636,"props":1965,"children":1966},{"style":648},[1967],{"type":612,"value":1968},", text2)\n",{"type":606,"tag":636,"props":1970,"children":1971},{"class":638,"line":135},[1972,1976,1980,1984,1989,1993,1998,2002,2006],{"type":606,"tag":636,"props":1973,"children":1974},{"style":727},[1975],{"type":612,"value":908},{"type":606,"tag":636,"props":1977,"children":1978},{"style":648},[1979],{"type":612,"value":913},{"type":606,"tag":636,"props":1981,"children":1982},{"style":642},[1983],{"type":612,"value":918},{"type":606,"tag":636,"props":1985,"children":1986},{"style":684},[1987],{"type":612,"value":1988},"\"Swapped: ",{"type":606,"tag":636,"props":1990,"children":1991},{"style":727},[1992],{"type":612,"value":928},{"type":606,"tag":636,"props":1994,"children":1995},{"style":648},[1996],{"type":612,"value":1997},"swapped",{"type":606,"tag":636,"props":1999,"children":2000},{"style":727},[2001],{"type":612,"value":938},{"type":606,"tag":636,"props":2003,"children":2004},{"style":684},[2005],{"type":612,"value":943},{"type":606,"tag":636,"props":2007,"children":2008},{"style":648},[2009],{"type":612,"value":948},{"type":606,"tag":636,"props":2011,"children":2012},{"class":638,"line":144},[2013],{"type":606,"tag":636,"props":2014,"children":2015},{"emptyLinePlaceholder":13},[2016],{"type":612,"value":659},{"type":606,"tag":636,"props":2018,"children":2019},{"class":638,"line":153},[2020],{"type":606,"tag":636,"props":2021,"children":2022},{"style":665},[2023],{"type":612,"value":2024},"# Remove extra whitespace\n",{"type":606,"tag":636,"props":2026,"children":2027},{"class":638,"line":163},[2028,2033,2037],{"type":606,"tag":636,"props":2029,"children":2030},{"style":648},[2031],{"type":612,"value":2032},"messy_text ",{"type":606,"tag":636,"props":2034,"children":2035},{"style":642},[2036],{"type":612,"value":681},{"type":606,"tag":636,"props":2038,"children":2039},{"style":684},[2040],{"type":612,"value":2041}," \"Hello    world   with    spaces\"\n",{"type":606,"tag":636,"props":2043,"children":2044},{"class":638,"line":172},[2045,2050,2054,2058,2062,2066,2071,2075,2079,2083,2088],{"type":606,"tag":636,"props":2046,"children":2047},{"style":648},[2048],{"type":612,"value":2049},"cleaned ",{"type":606,"tag":636,"props":2051,"children":2052},{"style":642},[2053],{"type":612,"value":681},{"type":606,"tag":636,"props":2055,"children":2056},{"style":648},[2057],{"type":612,"value":1738},{"type":606,"tag":636,"props":2059,"children":2060},{"style":642},[2061],{"type":612,"value":1316},{"type":606,"tag":636,"props":2063,"children":2064},{"style":684},[2065],{"type":612,"value":724},{"type":606,"tag":636,"props":2067,"children":2068},{"style":727},[2069],{"type":612,"value":2070},"\\s",{"type":606,"tag":636,"props":2072,"children":2073},{"style":642},[2074],{"type":612,"value":735},{"type":606,"tag":636,"props":2076,"children":2077},{"style":684},[2078],{"type":612,"value":724},{"type":606,"tag":636,"props":2080,"children":2081},{"style":648},[2082],{"type":612,"value":1787},{"type":606,"tag":636,"props":2084,"children":2085},{"style":684},[2086],{"type":612,"value":2087},"' '",{"type":606,"tag":636,"props":2089,"children":2090},{"style":648},[2091],{"type":612,"value":2092},", messy_text)\n",{"type":606,"tag":636,"props":2094,"children":2095},{"class":638,"line":181},[2096,2100,2104,2108,2113,2117,2122,2126,2130],{"type":606,"tag":636,"props":2097,"children":2098},{"style":727},[2099],{"type":612,"value":908},{"type":606,"tag":636,"props":2101,"children":2102},{"style":648},[2103],{"type":612,"value":913},{"type":606,"tag":636,"props":2105,"children":2106},{"style":642},[2107],{"type":612,"value":918},{"type":606,"tag":636,"props":2109,"children":2110},{"style":684},[2111],{"type":612,"value":2112},"\"Cleaned: ",{"type":606,"tag":636,"props":2114,"children":2115},{"style":727},[2116],{"type":612,"value":928},{"type":606,"tag":636,"props":2118,"children":2119},{"style":648},[2120],{"type":612,"value":2121},"cleaned",{"type":606,"tag":636,"props":2123,"children":2124},{"style":727},[2125],{"type":612,"value":938},{"type":606,"tag":636,"props":2127,"children":2128},{"style":684},[2129],{"type":612,"value":943},{"type":606,"tag":636,"props":2131,"children":2132},{"style":648},[2133],{"type":612,"value":948},{"type":606,"tag":1083,"props":2135,"children":2137},{"id":2136},"regex-pattern-reference",[2138],{"type":612,"value":2139},"📋 Regex Pattern Reference",{"type":606,"tag":2141,"props":2142,"children":2143},"table",{},[2144,2168],{"type":606,"tag":2145,"props":2146,"children":2147},"thead",{},[2148],{"type":606,"tag":2149,"props":2150,"children":2151},"tr",{},[2152,2158,2163],{"type":606,"tag":2153,"props":2154,"children":2155},"th",{},[2156],{"type":612,"value":2157},"Pattern",{"type":606,"tag":2153,"props":2159,"children":2160},{},[2161],{"type":612,"value":2162},"Meaning",{"type":606,"tag":2153,"props":2164,"children":2165},{},[2166],{"type":612,"value":2167},"Example",{"type":606,"tag":2169,"props":2170,"children":2171},"tbody",{},[2172,2201,2228,2256,2283,2311,2338,2366,2394],{"type":606,"tag":2149,"props":2173,"children":2174},{},[2175,2185,2190],{"type":606,"tag":2176,"props":2177,"children":2178},"td",{},[2179],{"type":606,"tag":632,"props":2180,"children":2182},{"className":2181},[],[2183],{"type":612,"value":2184},".",{"type":606,"tag":2176,"props":2186,"children":2187},{},[2188],{"type":612,"value":2189},"Any character",{"type":606,"tag":2176,"props":2191,"children":2192},{},[2193,2199],{"type":606,"tag":632,"props":2194,"children":2196},{"className":2195},[],[2197],{"type":612,"value":2198},"a.c",{"type":612,"value":2200}," matches \"abc\", \"a1c\"",{"type":606,"tag":2149,"props":2202,"children":2203},{},[2204,2212,2217],{"type":606,"tag":2176,"props":2205,"children":2206},{},[2207],{"type":606,"tag":632,"props":2208,"children":2210},{"className":2209},[],[2211],{"type":612,"value":839},{"type":606,"tag":2176,"props":2213,"children":2214},{},[2215],{"type":612,"value":2216},"Any digit",{"type":606,"tag":2176,"props":2218,"children":2219},{},[2220,2226],{"type":606,"tag":632,"props":2221,"children":2223},{"className":2222},[],[2224],{"type":612,"value":2225},"\\d{3}",{"type":612,"value":2227}," matches \"123\"",{"type":606,"tag":2149,"props":2229,"children":2230},{},[2231,2240,2245],{"type":606,"tag":2176,"props":2232,"children":2233},{},[2234],{"type":606,"tag":632,"props":2235,"children":2237},{"className":2236},[],[2238],{"type":612,"value":2239},"\\w",{"type":606,"tag":2176,"props":2241,"children":2242},{},[2243],{"type":612,"value":2244},"Word character",{"type":606,"tag":2176,"props":2246,"children":2247},{},[2248,2254],{"type":606,"tag":632,"props":2249,"children":2251},{"className":2250},[],[2252],{"type":612,"value":2253},"\\w+",{"type":612,"value":2255}," matches \"hello\"",{"type":606,"tag":2149,"props":2257,"children":2258},{},[2259,2267,2272],{"type":606,"tag":2176,"props":2260,"children":2261},{},[2262],{"type":606,"tag":632,"props":2263,"children":2265},{"className":2264},[],[2266],{"type":612,"value":2070},{"type":606,"tag":2176,"props":2268,"children":2269},{},[2270],{"type":612,"value":2271},"Whitespace",{"type":606,"tag":2176,"props":2273,"children":2274},{},[2275,2281],{"type":606,"tag":632,"props":2276,"children":2278},{"className":2277},[],[2279],{"type":612,"value":2280},"\\s+",{"type":612,"value":2282}," matches spaces/tabs",{"type":606,"tag":2149,"props":2284,"children":2285},{},[2286,2295,2300],{"type":606,"tag":2176,"props":2287,"children":2288},{},[2289],{"type":606,"tag":632,"props":2290,"children":2292},{"className":2291},[],[2293],{"type":612,"value":2294},"*",{"type":606,"tag":2176,"props":2296,"children":2297},{},[2298],{"type":612,"value":2299},"Zero or more",{"type":606,"tag":2176,"props":2301,"children":2302},{},[2303,2309],{"type":606,"tag":632,"props":2304,"children":2306},{"className":2305},[],[2307],{"type":612,"value":2308},"a*",{"type":612,"value":2310}," matches \"\", \"a\", \"aa\"",{"type":606,"tag":2149,"props":2312,"children":2313},{},[2314,2322,2327],{"type":606,"tag":2176,"props":2315,"children":2316},{},[2317],{"type":606,"tag":632,"props":2318,"children":2320},{"className":2319},[],[2321],{"type":612,"value":735},{"type":606,"tag":2176,"props":2323,"children":2324},{},[2325],{"type":612,"value":2326},"One or more",{"type":606,"tag":2176,"props":2328,"children":2329},{},[2330,2336],{"type":606,"tag":632,"props":2331,"children":2333},{"className":2332},[],[2334],{"type":612,"value":2335},"a+",{"type":612,"value":2337}," matches \"a\", \"aa\"",{"type":606,"tag":2149,"props":2339,"children":2340},{},[2341,2350,2355],{"type":606,"tag":2176,"props":2342,"children":2343},{},[2344],{"type":606,"tag":632,"props":2345,"children":2347},{"className":2346},[],[2348],{"type":612,"value":2349},"?",{"type":606,"tag":2176,"props":2351,"children":2352},{},[2353],{"type":612,"value":2354},"Zero or one",{"type":606,"tag":2176,"props":2356,"children":2357},{},[2358,2364],{"type":606,"tag":632,"props":2359,"children":2361},{"className":2360},[],[2362],{"type":612,"value":2363},"a?",{"type":612,"value":2365}," matches \"\", \"a\"",{"type":606,"tag":2149,"props":2367,"children":2368},{},[2369,2378,2383],{"type":606,"tag":2176,"props":2370,"children":2371},{},[2372],{"type":606,"tag":632,"props":2373,"children":2375},{"className":2374},[],[2376],{"type":612,"value":2377},"[]",{"type":606,"tag":2176,"props":2379,"children":2380},{},[2381],{"type":612,"value":2382},"Character set",{"type":606,"tag":2176,"props":2384,"children":2385},{},[2386,2392],{"type":606,"tag":632,"props":2387,"children":2389},{"className":2388},[],[2390],{"type":612,"value":2391},"[abc]",{"type":612,"value":2393}," matches \"a\", \"b\", \"c\"",{"type":606,"tag":2149,"props":2395,"children":2396},{},[2397,2406,2411],{"type":606,"tag":2176,"props":2398,"children":2399},{},[2400],{"type":606,"tag":632,"props":2401,"children":2403},{"className":2402},[],[2404],{"type":612,"value":2405},"()",{"type":606,"tag":2176,"props":2407,"children":2408},{},[2409],{"type":612,"value":2410},"Group",{"type":606,"tag":2176,"props":2412,"children":2413},{},[2414,2420],{"type":606,"tag":632,"props":2415,"children":2417},{"className":2416},[],[2418],{"type":612,"value":2419},"(abc)+",{"type":612,"value":2421}," matches \"abc\", \"abcabc\"",{"type":606,"tag":1083,"props":2423,"children":2425},{"id":2424},"common-regex-patterns",[2426],{"type":612,"value":2427},"🔧 Common Regex Patterns",{"type":606,"tag":1230,"props":2429,"children":2431},{"id":2430},"email-validation",[2432],{"type":612,"value":2433},"Email Validation",{"type":606,"tag":621,"props":2435,"children":2436},{},[2437],{"type":606,"tag":625,"props":2438,"children":2440},{"className":627,"code":2439,"language":629,"meta":8,"style":8},"import re\n\ndef validate_email(email):\n    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$'\n    return re.match(pattern, email) is not None\n\ndef extract_emails(text):\n    pattern = r'\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b'\n    return re.findall(pattern, text)\n\n# Test email validation\nemails_to_test = [\n    \"user@example.com\",\n    \"invalid.email\",\n    \"test@domain.co.uk\",\n    \"bad@email\"\n]\n\nfor email in emails_to_test:\n    valid = validate_email(email)\n    print(f\"{email}: {'Valid' if valid else 'Invalid'}\")\n\n# Extract emails from text\ntext = \"Contact us at support@company.com or sales@company.org\"\nfound_emails = extract_emails(text)\nprint(f\"Found emails: {found_emails}\")\n",[2441],{"type":606,"tag":632,"props":2442,"children":2443},{"__ignoreMap":8},[2444,2455,2462,2481,2545,2571,2578,2595,2654,2666,2673,2681,2698,2711,2723,2735,2743,2751,2758,2781,2798,2876,2883,2891,2907,2924],{"type":606,"tag":636,"props":2445,"children":2446},{"class":638,"line":12},[2447,2451],{"type":606,"tag":636,"props":2448,"children":2449},{"style":642},[2450],{"type":612,"value":645},{"type":606,"tag":636,"props":2452,"children":2453},{"style":648},[2454],{"type":612,"value":651},{"type":606,"tag":636,"props":2456,"children":2457},{"class":638,"line":27},[2458],{"type":606,"tag":636,"props":2459,"children":2460},{"emptyLinePlaceholder":13},[2461],{"type":612,"value":659},{"type":606,"tag":636,"props":2463,"children":2464},{"class":638,"line":36},[2465,2470,2476],{"type":606,"tag":636,"props":2466,"children":2467},{"style":642},[2468],{"type":612,"value":2469},"def",{"type":606,"tag":636,"props":2471,"children":2473},{"style":2472},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2474],{"type":612,"value":2475}," validate_email",{"type":606,"tag":636,"props":2477,"children":2478},{"style":648},[2479],{"type":612,"value":2480},"(email):\n",{"type":606,"tag":636,"props":2482,"children":2483},{"class":638,"line":45},[2484,2489,2493,2497,2501,2506,2510,2514,2519,2523,2527,2532,2536,2541],{"type":606,"tag":636,"props":2485,"children":2486},{"style":648},[2487],{"type":612,"value":2488},"    pattern ",{"type":606,"tag":636,"props":2490,"children":2491},{"style":642},[2492],{"type":612,"value":681},{"type":606,"tag":636,"props":2494,"children":2495},{"style":642},[2496],{"type":612,"value":719},{"type":606,"tag":636,"props":2498,"children":2499},{"style":684},[2500],{"type":612,"value":724},{"type":606,"tag":636,"props":2502,"children":2503},{"style":727},[2504],{"type":612,"value":2505},"^[a-zA-Z0-9._%+-]",{"type":606,"tag":636,"props":2507,"children":2508},{"style":642},[2509],{"type":612,"value":735},{"type":606,"tag":636,"props":2511,"children":2512},{"style":738},[2513],{"type":612,"value":741},{"type":606,"tag":636,"props":2515,"children":2516},{"style":727},[2517],{"type":612,"value":2518},"[a-zA-Z0-9.-]",{"type":606,"tag":636,"props":2520,"children":2521},{"style":642},[2522],{"type":612,"value":735},{"type":606,"tag":636,"props":2524,"children":2525},{"style":753},[2526],{"type":612,"value":756},{"type":606,"tag":636,"props":2528,"children":2529},{"style":727},[2530],{"type":612,"value":2531},"[a-zA-Z]",{"type":606,"tag":636,"props":2533,"children":2534},{"style":642},[2535],{"type":612,"value":766},{"type":606,"tag":636,"props":2537,"children":2538},{"style":727},[2539],{"type":612,"value":2540},"$",{"type":606,"tag":636,"props":2542,"children":2543},{"style":684},[2544],{"type":612,"value":776},{"type":606,"tag":636,"props":2546,"children":2547},{"class":638,"line":54},[2548,2553,2558,2562,2566],{"type":606,"tag":636,"props":2549,"children":2550},{"style":642},[2551],{"type":612,"value":2552},"    return",{"type":606,"tag":636,"props":2554,"children":2555},{"style":648},[2556],{"type":612,"value":2557}," re.match(pattern, email) ",{"type":606,"tag":636,"props":2559,"children":2560},{"style":642},[2561],{"type":612,"value":1063},{"type":606,"tag":636,"props":2563,"children":2564},{"style":642},[2565],{"type":612,"value":1068},{"type":606,"tag":636,"props":2567,"children":2568},{"style":727},[2569],{"type":612,"value":2570}," None\n",{"type":606,"tag":636,"props":2572,"children":2573},{"class":638,"line":63},[2574],{"type":606,"tag":636,"props":2575,"children":2576},{"emptyLinePlaceholder":13},[2577],{"type":612,"value":659},{"type":606,"tag":636,"props":2579,"children":2580},{"class":638,"line":72},[2581,2585,2590],{"type":606,"tag":636,"props":2582,"children":2583},{"style":642},[2584],{"type":612,"value":2469},{"type":606,"tag":636,"props":2586,"children":2587},{"style":2472},[2588],{"type":612,"value":2589}," extract_emails",{"type":606,"tag":636,"props":2591,"children":2592},{"style":648},[2593],{"type":612,"value":2594},"(text):\n",{"type":606,"tag":636,"props":2596,"children":2597},{"class":638,"line":81},[2598,2602,2606,2610,2614,2618,2622,2626,2630,2634,2638,2642,2646,2650],{"type":606,"tag":636,"props":2599,"children":2600},{"style":648},[2601],{"type":612,"value":2488},{"type":606,"tag":636,"props":2603,"children":2604},{"style":642},[2605],{"type":612,"value":681},{"type":606,"tag":636,"props":2607,"children":2608},{"style":642},[2609],{"type":612,"value":719},{"type":606,"tag":636,"props":2611,"children":2612},{"style":684},[2613],{"type":612,"value":724},{"type":606,"tag":636,"props":2615,"children":2616},{"style":727},[2617],{"type":612,"value":730},{"type":606,"tag":636,"props":2619,"children":2620},{"style":642},[2621],{"type":612,"value":735},{"type":606,"tag":636,"props":2623,"children":2624},{"style":738},[2625],{"type":612,"value":741},{"type":606,"tag":636,"props":2627,"children":2628},{"style":727},[2629],{"type":612,"value":746},{"type":606,"tag":636,"props":2631,"children":2632},{"style":642},[2633],{"type":612,"value":735},{"type":606,"tag":636,"props":2635,"children":2636},{"style":753},[2637],{"type":612,"value":756},{"type":606,"tag":636,"props":2639,"children":2640},{"style":727},[2641],{"type":612,"value":761},{"type":606,"tag":636,"props":2643,"children":2644},{"style":642},[2645],{"type":612,"value":766},{"type":606,"tag":636,"props":2647,"children":2648},{"style":727},[2649],{"type":612,"value":771},{"type":606,"tag":636,"props":2651,"children":2652},{"style":684},[2653],{"type":612,"value":776},{"type":606,"tag":636,"props":2655,"children":2656},{"class":638,"line":796},[2657,2661],{"type":606,"tag":636,"props":2658,"children":2659},{"style":642},[2660],{"type":612,"value":2552},{"type":606,"tag":636,"props":2662,"children":2663},{"style":648},[2664],{"type":612,"value":2665}," re.findall(pattern, text)\n",{"type":606,"tag":636,"props":2667,"children":2668},{"class":638,"line":99},[2669],{"type":606,"tag":636,"props":2670,"children":2671},{"emptyLinePlaceholder":13},[2672],{"type":612,"value":659},{"type":606,"tag":636,"props":2674,"children":2675},{"class":638,"line":108},[2676],{"type":606,"tag":636,"props":2677,"children":2678},{"style":665},[2679],{"type":612,"value":2680},"# Test email validation\n",{"type":606,"tag":636,"props":2682,"children":2683},{"class":638,"line":117},[2684,2689,2693],{"type":606,"tag":636,"props":2685,"children":2686},{"style":648},[2687],{"type":612,"value":2688},"emails_to_test ",{"type":606,"tag":636,"props":2690,"children":2691},{"style":642},[2692],{"type":612,"value":681},{"type":606,"tag":636,"props":2694,"children":2695},{"style":648},[2696],{"type":612,"value":2697}," [\n",{"type":606,"tag":636,"props":2699,"children":2700},{"class":638,"line":126},[2701,2706],{"type":606,"tag":636,"props":2702,"children":2703},{"style":684},[2704],{"type":612,"value":2705},"    \"user@example.com\"",{"type":606,"tag":636,"props":2707,"children":2708},{"style":648},[2709],{"type":612,"value":2710},",\n",{"type":606,"tag":636,"props":2712,"children":2713},{"class":638,"line":135},[2714,2719],{"type":606,"tag":636,"props":2715,"children":2716},{"style":684},[2717],{"type":612,"value":2718},"    \"invalid.email\"",{"type":606,"tag":636,"props":2720,"children":2721},{"style":648},[2722],{"type":612,"value":2710},{"type":606,"tag":636,"props":2724,"children":2725},{"class":638,"line":144},[2726,2731],{"type":606,"tag":636,"props":2727,"children":2728},{"style":684},[2729],{"type":612,"value":2730},"    \"test@domain.co.uk\"",{"type":606,"tag":636,"props":2732,"children":2733},{"style":648},[2734],{"type":612,"value":2710},{"type":606,"tag":636,"props":2736,"children":2737},{"class":638,"line":153},[2738],{"type":606,"tag":636,"props":2739,"children":2740},{"style":684},[2741],{"type":612,"value":2742},"    \"bad@email\"\n",{"type":606,"tag":636,"props":2744,"children":2745},{"class":638,"line":163},[2746],{"type":606,"tag":636,"props":2747,"children":2748},{"style":648},[2749],{"type":612,"value":2750},"]\n",{"type":606,"tag":636,"props":2752,"children":2753},{"class":638,"line":172},[2754],{"type":606,"tag":636,"props":2755,"children":2756},{"emptyLinePlaceholder":13},[2757],{"type":612,"value":659},{"type":606,"tag":636,"props":2759,"children":2760},{"class":638,"line":181},[2761,2766,2771,2776],{"type":606,"tag":636,"props":2762,"children":2763},{"style":642},[2764],{"type":612,"value":2765},"for",{"type":606,"tag":636,"props":2767,"children":2768},{"style":648},[2769],{"type":612,"value":2770}," email ",{"type":606,"tag":636,"props":2772,"children":2773},{"style":642},[2774],{"type":612,"value":2775},"in",{"type":606,"tag":636,"props":2777,"children":2778},{"style":648},[2779],{"type":612,"value":2780}," emails_to_test:\n",{"type":606,"tag":636,"props":2782,"children":2783},{"class":638,"line":190},[2784,2789,2793],{"type":606,"tag":636,"props":2785,"children":2786},{"style":648},[2787],{"type":612,"value":2788},"    valid ",{"type":606,"tag":636,"props":2790,"children":2791},{"style":642},[2792],{"type":612,"value":681},{"type":606,"tag":636,"props":2794,"children":2795},{"style":648},[2796],{"type":612,"value":2797}," validate_email(email)\n",{"type":606,"tag":636,"props":2799,"children":2800},{"class":638,"line":199},[2801,2805,2809,2813,2817,2821,2826,2830,2835,2839,2844,2849,2854,2859,2864,2868,2872],{"type":606,"tag":636,"props":2802,"children":2803},{"style":727},[2804],{"type":612,"value":1556},{"type":606,"tag":636,"props":2806,"children":2807},{"style":648},[2808],{"type":612,"value":913},{"type":606,"tag":636,"props":2810,"children":2811},{"style":642},[2812],{"type":612,"value":918},{"type":606,"tag":636,"props":2814,"children":2815},{"style":684},[2816],{"type":612,"value":943},{"type":606,"tag":636,"props":2818,"children":2819},{"style":727},[2820],{"type":612,"value":928},{"type":606,"tag":636,"props":2822,"children":2823},{"style":648},[2824],{"type":612,"value":2825},"email",{"type":606,"tag":636,"props":2827,"children":2828},{"style":727},[2829],{"type":612,"value":938},{"type":606,"tag":636,"props":2831,"children":2832},{"style":684},[2833],{"type":612,"value":2834},": ",{"type":606,"tag":636,"props":2836,"children":2837},{"style":727},[2838],{"type":612,"value":928},{"type":606,"tag":636,"props":2840,"children":2841},{"style":684},[2842],{"type":612,"value":2843},"'Valid'",{"type":606,"tag":636,"props":2845,"children":2846},{"style":642},[2847],{"type":612,"value":2848}," if",{"type":606,"tag":636,"props":2850,"children":2851},{"style":648},[2852],{"type":612,"value":2853}," valid ",{"type":606,"tag":636,"props":2855,"children":2856},{"style":642},[2857],{"type":612,"value":2858},"else",{"type":606,"tag":636,"props":2860,"children":2861},{"style":684},[2862],{"type":612,"value":2863}," 'Invalid'",{"type":606,"tag":636,"props":2865,"children":2866},{"style":727},[2867],{"type":612,"value":938},{"type":606,"tag":636,"props":2869,"children":2870},{"style":684},[2871],{"type":612,"value":943},{"type":606,"tag":636,"props":2873,"children":2874},{"style":648},[2875],{"type":612,"value":948},{"type":606,"tag":636,"props":2877,"children":2878},{"class":638,"line":208},[2879],{"type":606,"tag":636,"props":2880,"children":2881},{"emptyLinePlaceholder":13},[2882],{"type":612,"value":659},{"type":606,"tag":636,"props":2884,"children":2885},{"class":638,"line":217},[2886],{"type":606,"tag":636,"props":2887,"children":2888},{"style":665},[2889],{"type":612,"value":2890},"# Extract emails from text\n",{"type":606,"tag":636,"props":2892,"children":2893},{"class":638,"line":227},[2894,2898,2902],{"type":606,"tag":636,"props":2895,"children":2896},{"style":648},[2897],{"type":612,"value":676},{"type":606,"tag":636,"props":2899,"children":2900},{"style":642},[2901],{"type":612,"value":681},{"type":606,"tag":636,"props":2903,"children":2904},{"style":684},[2905],{"type":612,"value":2906}," \"Contact us at support@company.com or sales@company.org\"\n",{"type":606,"tag":636,"props":2908,"children":2909},{"class":638,"line":236},[2910,2915,2919],{"type":606,"tag":636,"props":2911,"children":2912},{"style":648},[2913],{"type":612,"value":2914},"found_emails ",{"type":606,"tag":636,"props":2916,"children":2917},{"style":642},[2918],{"type":612,"value":681},{"type":606,"tag":636,"props":2920,"children":2921},{"style":648},[2922],{"type":612,"value":2923}," extract_emails(text)\n",{"type":606,"tag":636,"props":2925,"children":2926},{"class":638,"line":245},[2927,2931,2935,2939,2943,2947,2952,2956,2960],{"type":606,"tag":636,"props":2928,"children":2929},{"style":727},[2930],{"type":612,"value":908},{"type":606,"tag":636,"props":2932,"children":2933},{"style":648},[2934],{"type":612,"value":913},{"type":606,"tag":636,"props":2936,"children":2937},{"style":642},[2938],{"type":612,"value":918},{"type":606,"tag":636,"props":2940,"children":2941},{"style":684},[2942],{"type":612,"value":923},{"type":606,"tag":636,"props":2944,"children":2945},{"style":727},[2946],{"type":612,"value":928},{"type":606,"tag":636,"props":2948,"children":2949},{"style":648},[2950],{"type":612,"value":2951},"found_emails",{"type":606,"tag":636,"props":2953,"children":2954},{"style":727},[2955],{"type":612,"value":938},{"type":606,"tag":636,"props":2957,"children":2958},{"style":684},[2959],{"type":612,"value":943},{"type":606,"tag":636,"props":2961,"children":2962},{"style":648},[2963],{"type":612,"value":948},{"type":606,"tag":1230,"props":2965,"children":2967},{"id":2966},"phone-number-processing",[2968],{"type":612,"value":2969},"Phone Number Processing",{"type":606,"tag":621,"props":2971,"children":2972},{},[2973],{"type":606,"tag":625,"props":2974,"children":2976},{"className":627,"code":2975,"language":629,"meta":8,"style":8},"import re\n\ndef format_phone(phone):\n    # Remove all non-digits\n    digits = re.sub(r'\\D', '', phone)\n    \n    # Check if it's a valid 10-digit US number\n    if len(digits) == 10:\n        return f\"({digits[:3]}) {digits[3:6]}-{digits[6:]}\"\n    elif len(digits) == 11 and digits[0] == '1':\n        return f\"({digits[1:4]}) {digits[4:7]}-{digits[7:]}\"\n    else:\n        return \"Invalid phone number\"\n\ndef extract_phone_numbers(text):\n    # Pattern for various phone formats\n    patterns = [\n        r'\\(\\d{3}\\) \\d{3}-\\d{4}',  # (555) 123-4567\n        r'\\d{3}-\\d{3}-\\d{4}',      # 555-123-4567\n        r'\\d{3}\\.\\d{3}\\.\\d{4}',    # 555.123.4567\n        r'\\d{10}'                   # 5551234567\n    ]\n    \n    phones = []\n    for pattern in patterns:\n        phones.extend(re.findall(pattern, text))\n    return phones\n\n# Test phone formatting\nphone_numbers = [\n    \"5551234567\",\n    \"1-555-123-4567\",\n    \"(555) 123-4567\",\n    \"555.123.4567\"\n]\n\nfor phone in phone_numbers:\n    formatted = format_phone(phone)\n    print(f\"{phone} → {formatted}\")\n\n# Extract from text\ntext = \"Call (555) 123-4567 or 555.987.6543 for support\"\nfound_phones = extract_phone_numbers(text)\nprint(f\"Found phones: {found_phones}\")\n",[2977],{"type":606,"tag":632,"props":2978,"children":2979},{"__ignoreMap":8},[2980,2991,2998,3015,3023,3070,3078,3086,3119,3226,3284,3390,3402,3414,3421,3437,3445,3461,3523,3580,3637,3666,3674,3681,3698,3720,3728,3740,3747,3755,3771,3783,3795,3807,3815,3822,3829,3850,3867,3925,3932,3940,3956,3973],{"type":606,"tag":636,"props":2981,"children":2982},{"class":638,"line":12},[2983,2987],{"type":606,"tag":636,"props":2984,"children":2985},{"style":642},[2986],{"type":612,"value":645},{"type":606,"tag":636,"props":2988,"children":2989},{"style":648},[2990],{"type":612,"value":651},{"type":606,"tag":636,"props":2992,"children":2993},{"class":638,"line":27},[2994],{"type":606,"tag":636,"props":2995,"children":2996},{"emptyLinePlaceholder":13},[2997],{"type":612,"value":659},{"type":606,"tag":636,"props":2999,"children":3000},{"class":638,"line":36},[3001,3005,3010],{"type":606,"tag":636,"props":3002,"children":3003},{"style":642},[3004],{"type":612,"value":2469},{"type":606,"tag":636,"props":3006,"children":3007},{"style":2472},[3008],{"type":612,"value":3009}," format_phone",{"type":606,"tag":636,"props":3011,"children":3012},{"style":648},[3013],{"type":612,"value":3014},"(phone):\n",{"type":606,"tag":636,"props":3016,"children":3017},{"class":638,"line":45},[3018],{"type":606,"tag":636,"props":3019,"children":3020},{"style":665},[3021],{"type":612,"value":3022},"    # Remove all non-digits\n",{"type":606,"tag":636,"props":3024,"children":3025},{"class":638,"line":54},[3026,3031,3035,3039,3043,3047,3052,3056,3060,3065],{"type":606,"tag":636,"props":3027,"children":3028},{"style":648},[3029],{"type":612,"value":3030},"    digits ",{"type":606,"tag":636,"props":3032,"children":3033},{"style":642},[3034],{"type":612,"value":681},{"type":606,"tag":636,"props":3036,"children":3037},{"style":648},[3038],{"type":612,"value":1738},{"type":606,"tag":636,"props":3040,"children":3041},{"style":642},[3042],{"type":612,"value":1316},{"type":606,"tag":636,"props":3044,"children":3045},{"style":684},[3046],{"type":612,"value":724},{"type":606,"tag":636,"props":3048,"children":3049},{"style":727},[3050],{"type":612,"value":3051},"\\D",{"type":606,"tag":636,"props":3053,"children":3054},{"style":684},[3055],{"type":612,"value":724},{"type":606,"tag":636,"props":3057,"children":3058},{"style":648},[3059],{"type":612,"value":1787},{"type":606,"tag":636,"props":3061,"children":3062},{"style":684},[3063],{"type":612,"value":3064},"''",{"type":606,"tag":636,"props":3066,"children":3067},{"style":648},[3068],{"type":612,"value":3069},", phone)\n",{"type":606,"tag":636,"props":3071,"children":3072},{"class":638,"line":63},[3073],{"type":606,"tag":636,"props":3074,"children":3075},{"style":648},[3076],{"type":612,"value":3077},"    \n",{"type":606,"tag":636,"props":3079,"children":3080},{"class":638,"line":72},[3081],{"type":606,"tag":636,"props":3082,"children":3083},{"style":665},[3084],{"type":612,"value":3085},"    # Check if it's a valid 10-digit US number\n",{"type":606,"tag":636,"props":3087,"children":3088},{"class":638,"line":81},[3089,3094,3099,3104,3109,3114],{"type":606,"tag":636,"props":3090,"children":3091},{"style":642},[3092],{"type":612,"value":3093},"    if",{"type":606,"tag":636,"props":3095,"children":3096},{"style":727},[3097],{"type":612,"value":3098}," len",{"type":606,"tag":636,"props":3100,"children":3101},{"style":648},[3102],{"type":612,"value":3103},"(digits) ",{"type":606,"tag":636,"props":3105,"children":3106},{"style":642},[3107],{"type":612,"value":3108},"==",{"type":606,"tag":636,"props":3110,"children":3111},{"style":727},[3112],{"type":612,"value":3113}," 10",{"type":606,"tag":636,"props":3115,"children":3116},{"style":648},[3117],{"type":612,"value":3118},":\n",{"type":606,"tag":636,"props":3120,"children":3121},{"class":638,"line":796},[3122,3127,3132,3137,3141,3146,3151,3156,3160,3165,3169,3174,3178,3183,3188,3192,3196,3200,3204,3208,3212,3217,3221],{"type":606,"tag":636,"props":3123,"children":3124},{"style":642},[3125],{"type":612,"value":3126},"        return",{"type":606,"tag":636,"props":3128,"children":3129},{"style":642},[3130],{"type":612,"value":3131}," f",{"type":606,"tag":636,"props":3133,"children":3134},{"style":684},[3135],{"type":612,"value":3136},"\"(",{"type":606,"tag":636,"props":3138,"children":3139},{"style":727},[3140],{"type":612,"value":928},{"type":606,"tag":636,"props":3142,"children":3143},{"style":648},[3144],{"type":612,"value":3145},"digits[:",{"type":606,"tag":636,"props":3147,"children":3148},{"style":727},[3149],{"type":612,"value":3150},"3",{"type":606,"tag":636,"props":3152,"children":3153},{"style":648},[3154],{"type":612,"value":3155},"]",{"type":606,"tag":636,"props":3157,"children":3158},{"style":727},[3159],{"type":612,"value":938},{"type":606,"tag":636,"props":3161,"children":3162},{"style":684},[3163],{"type":612,"value":3164},") ",{"type":606,"tag":636,"props":3166,"children":3167},{"style":727},[3168],{"type":612,"value":928},{"type":606,"tag":636,"props":3170,"children":3171},{"style":648},[3172],{"type":612,"value":3173},"digits[",{"type":606,"tag":636,"props":3175,"children":3176},{"style":727},[3177],{"type":612,"value":3150},{"type":606,"tag":636,"props":3179,"children":3180},{"style":648},[3181],{"type":612,"value":3182},":",{"type":606,"tag":636,"props":3184,"children":3185},{"style":727},[3186],{"type":612,"value":3187},"6",{"type":606,"tag":636,"props":3189,"children":3190},{"style":648},[3191],{"type":612,"value":3155},{"type":606,"tag":636,"props":3193,"children":3194},{"style":727},[3195],{"type":612,"value":938},{"type":606,"tag":636,"props":3197,"children":3198},{"style":684},[3199],{"type":612,"value":863},{"type":606,"tag":636,"props":3201,"children":3202},{"style":727},[3203],{"type":612,"value":928},{"type":606,"tag":636,"props":3205,"children":3206},{"style":648},[3207],{"type":612,"value":3173},{"type":606,"tag":636,"props":3209,"children":3210},{"style":727},[3211],{"type":612,"value":3187},{"type":606,"tag":636,"props":3213,"children":3214},{"style":648},[3215],{"type":612,"value":3216},":]",{"type":606,"tag":636,"props":3218,"children":3219},{"style":727},[3220],{"type":612,"value":938},{"type":606,"tag":636,"props":3222,"children":3223},{"style":684},[3224],{"type":612,"value":3225},"\"\n",{"type":606,"tag":636,"props":3227,"children":3228},{"class":638,"line":99},[3229,3234,3238,3242,3246,3251,3256,3261,3266,3271,3275,3280],{"type":606,"tag":636,"props":3230,"children":3231},{"style":642},[3232],{"type":612,"value":3233},"    elif",{"type":606,"tag":636,"props":3235,"children":3236},{"style":727},[3237],{"type":612,"value":3098},{"type":606,"tag":636,"props":3239,"children":3240},{"style":648},[3241],{"type":612,"value":3103},{"type":606,"tag":636,"props":3243,"children":3244},{"style":642},[3245],{"type":612,"value":3108},{"type":606,"tag":636,"props":3247,"children":3248},{"style":727},[3249],{"type":612,"value":3250}," 11",{"type":606,"tag":636,"props":3252,"children":3253},{"style":642},[3254],{"type":612,"value":3255}," and",{"type":606,"tag":636,"props":3257,"children":3258},{"style":648},[3259],{"type":612,"value":3260}," digits[",{"type":606,"tag":636,"props":3262,"children":3263},{"style":727},[3264],{"type":612,"value":3265},"0",{"type":606,"tag":636,"props":3267,"children":3268},{"style":648},[3269],{"type":612,"value":3270},"] ",{"type":606,"tag":636,"props":3272,"children":3273},{"style":642},[3274],{"type":612,"value":3108},{"type":606,"tag":636,"props":3276,"children":3277},{"style":684},[3278],{"type":612,"value":3279}," '1'",{"type":606,"tag":636,"props":3281,"children":3282},{"style":648},[3283],{"type":612,"value":3118},{"type":606,"tag":636,"props":3285,"children":3286},{"class":638,"line":108},[3287,3291,3295,3299,3303,3307,3312,3316,3321,3325,3329,3333,3337,3341,3345,3349,3354,3358,3362,3366,3370,3374,3378,3382,3386],{"type":606,"tag":636,"props":3288,"children":3289},{"style":642},[3290],{"type":612,"value":3126},{"type":606,"tag":636,"props":3292,"children":3293},{"style":642},[3294],{"type":612,"value":3131},{"type":606,"tag":636,"props":3296,"children":3297},{"style":684},[3298],{"type":612,"value":3136},{"type":606,"tag":636,"props":3300,"children":3301},{"style":727},[3302],{"type":612,"value":928},{"type":606,"tag":636,"props":3304,"children":3305},{"style":648},[3306],{"type":612,"value":3173},{"type":606,"tag":636,"props":3308,"children":3309},{"style":727},[3310],{"type":612,"value":3311},"1",{"type":606,"tag":636,"props":3313,"children":3314},{"style":648},[3315],{"type":612,"value":3182},{"type":606,"tag":636,"props":3317,"children":3318},{"style":727},[3319],{"type":612,"value":3320},"4",{"type":606,"tag":636,"props":3322,"children":3323},{"style":648},[3324],{"type":612,"value":3155},{"type":606,"tag":636,"props":3326,"children":3327},{"style":727},[3328],{"type":612,"value":938},{"type":606,"tag":636,"props":3330,"children":3331},{"style":684},[3332],{"type":612,"value":3164},{"type":606,"tag":636,"props":3334,"children":3335},{"style":727},[3336],{"type":612,"value":928},{"type":606,"tag":636,"props":3338,"children":3339},{"style":648},[3340],{"type":612,"value":3173},{"type":606,"tag":636,"props":3342,"children":3343},{"style":727},[3344],{"type":612,"value":3320},{"type":606,"tag":636,"props":3346,"children":3347},{"style":648},[3348],{"type":612,"value":3182},{"type":606,"tag":636,"props":3350,"children":3351},{"style":727},[3352],{"type":612,"value":3353},"7",{"type":606,"tag":636,"props":3355,"children":3356},{"style":648},[3357],{"type":612,"value":3155},{"type":606,"tag":636,"props":3359,"children":3360},{"style":727},[3361],{"type":612,"value":938},{"type":606,"tag":636,"props":3363,"children":3364},{"style":684},[3365],{"type":612,"value":863},{"type":606,"tag":636,"props":3367,"children":3368},{"style":727},[3369],{"type":612,"value":928},{"type":606,"tag":636,"props":3371,"children":3372},{"style":648},[3373],{"type":612,"value":3173},{"type":606,"tag":636,"props":3375,"children":3376},{"style":727},[3377],{"type":612,"value":3353},{"type":606,"tag":636,"props":3379,"children":3380},{"style":648},[3381],{"type":612,"value":3216},{"type":606,"tag":636,"props":3383,"children":3384},{"style":727},[3385],{"type":612,"value":938},{"type":606,"tag":636,"props":3387,"children":3388},{"style":684},[3389],{"type":612,"value":3225},{"type":606,"tag":636,"props":3391,"children":3392},{"class":638,"line":117},[3393,3398],{"type":606,"tag":636,"props":3394,"children":3395},{"style":642},[3396],{"type":612,"value":3397},"    else",{"type":606,"tag":636,"props":3399,"children":3400},{"style":648},[3401],{"type":612,"value":3118},{"type":606,"tag":636,"props":3403,"children":3404},{"class":638,"line":126},[3405,3409],{"type":606,"tag":636,"props":3406,"children":3407},{"style":642},[3408],{"type":612,"value":3126},{"type":606,"tag":636,"props":3410,"children":3411},{"style":684},[3412],{"type":612,"value":3413}," \"Invalid phone number\"\n",{"type":606,"tag":636,"props":3415,"children":3416},{"class":638,"line":135},[3417],{"type":606,"tag":636,"props":3418,"children":3419},{"emptyLinePlaceholder":13},[3420],{"type":612,"value":659},{"type":606,"tag":636,"props":3422,"children":3423},{"class":638,"line":144},[3424,3428,3433],{"type":606,"tag":636,"props":3425,"children":3426},{"style":642},[3427],{"type":612,"value":2469},{"type":606,"tag":636,"props":3429,"children":3430},{"style":2472},[3431],{"type":612,"value":3432}," extract_phone_numbers",{"type":606,"tag":636,"props":3434,"children":3435},{"style":648},[3436],{"type":612,"value":2594},{"type":606,"tag":636,"props":3438,"children":3439},{"class":638,"line":153},[3440],{"type":606,"tag":636,"props":3441,"children":3442},{"style":665},[3443],{"type":612,"value":3444},"    # Pattern for various phone formats\n",{"type":606,"tag":636,"props":3446,"children":3447},{"class":638,"line":163},[3448,3453,3457],{"type":606,"tag":636,"props":3449,"children":3450},{"style":648},[3451],{"type":612,"value":3452},"    patterns ",{"type":606,"tag":636,"props":3454,"children":3455},{"style":642},[3456],{"type":612,"value":681},{"type":606,"tag":636,"props":3458,"children":3459},{"style":648},[3460],{"type":612,"value":2697},{"type":606,"tag":636,"props":3462,"children":3463},{"class":638,"line":172},[3464,3469,3473,3477,3481,3485,3489,3493,3497,3501,3505,3509,3513,3518],{"type":606,"tag":636,"props":3465,"children":3466},{"style":642},[3467],{"type":612,"value":3468},"        r",{"type":606,"tag":636,"props":3470,"children":3471},{"style":684},[3472],{"type":612,"value":724},{"type":606,"tag":636,"props":3474,"children":3475},{"style":753},[3476],{"type":612,"value":834},{"type":606,"tag":636,"props":3478,"children":3479},{"style":727},[3480],{"type":612,"value":839},{"type":606,"tag":636,"props":3482,"children":3483},{"style":642},[3484],{"type":612,"value":844},{"type":606,"tag":636,"props":3486,"children":3487},{"style":753},[3488],{"type":612,"value":849},{"type":606,"tag":636,"props":3490,"children":3491},{"style":727},[3492],{"type":612,"value":854},{"type":606,"tag":636,"props":3494,"children":3495},{"style":642},[3496],{"type":612,"value":844},{"type":606,"tag":636,"props":3498,"children":3499},{"style":738},[3500],{"type":612,"value":863},{"type":606,"tag":636,"props":3502,"children":3503},{"style":727},[3504],{"type":612,"value":839},{"type":606,"tag":636,"props":3506,"children":3507},{"style":642},[3508],{"type":612,"value":872},{"type":606,"tag":636,"props":3510,"children":3511},{"style":684},[3512],{"type":612,"value":724},{"type":606,"tag":636,"props":3514,"children":3515},{"style":648},[3516],{"type":612,"value":3517},",  ",{"type":606,"tag":636,"props":3519,"children":3520},{"style":665},[3521],{"type":612,"value":3522},"# (555) 123-4567\n",{"type":606,"tag":636,"props":3524,"children":3525},{"class":638,"line":181},[3526,3530,3534,3538,3542,3546,3550,3554,3558,3562,3566,3570,3575],{"type":606,"tag":636,"props":3527,"children":3528},{"style":642},[3529],{"type":612,"value":3468},{"type":606,"tag":636,"props":3531,"children":3532},{"style":684},[3533],{"type":612,"value":724},{"type":606,"tag":636,"props":3535,"children":3536},{"style":727},[3537],{"type":612,"value":839},{"type":606,"tag":636,"props":3539,"children":3540},{"style":642},[3541],{"type":612,"value":844},{"type":606,"tag":636,"props":3543,"children":3544},{"style":738},[3545],{"type":612,"value":863},{"type":606,"tag":636,"props":3547,"children":3548},{"style":727},[3549],{"type":612,"value":839},{"type":606,"tag":636,"props":3551,"children":3552},{"style":642},[3553],{"type":612,"value":844},{"type":606,"tag":636,"props":3555,"children":3556},{"style":738},[3557],{"type":612,"value":863},{"type":606,"tag":636,"props":3559,"children":3560},{"style":727},[3561],{"type":612,"value":839},{"type":606,"tag":636,"props":3563,"children":3564},{"style":642},[3565],{"type":612,"value":872},{"type":606,"tag":636,"props":3567,"children":3568},{"style":684},[3569],{"type":612,"value":724},{"type":606,"tag":636,"props":3571,"children":3572},{"style":648},[3573],{"type":612,"value":3574},",      ",{"type":606,"tag":636,"props":3576,"children":3577},{"style":665},[3578],{"type":612,"value":3579},"# 555-123-4567\n",{"type":606,"tag":636,"props":3581,"children":3582},{"class":638,"line":190},[3583,3587,3591,3595,3599,3603,3607,3611,3615,3619,3623,3627,3632],{"type":606,"tag":636,"props":3584,"children":3585},{"style":642},[3586],{"type":612,"value":3468},{"type":606,"tag":636,"props":3588,"children":3589},{"style":684},[3590],{"type":612,"value":724},{"type":606,"tag":636,"props":3592,"children":3593},{"style":727},[3594],{"type":612,"value":839},{"type":606,"tag":636,"props":3596,"children":3597},{"style":642},[3598],{"type":612,"value":844},{"type":606,"tag":636,"props":3600,"children":3601},{"style":753},[3602],{"type":612,"value":756},{"type":606,"tag":636,"props":3604,"children":3605},{"style":727},[3606],{"type":612,"value":839},{"type":606,"tag":636,"props":3608,"children":3609},{"style":642},[3610],{"type":612,"value":844},{"type":606,"tag":636,"props":3612,"children":3613},{"style":753},[3614],{"type":612,"value":756},{"type":606,"tag":636,"props":3616,"children":3617},{"style":727},[3618],{"type":612,"value":839},{"type":606,"tag":636,"props":3620,"children":3621},{"style":642},[3622],{"type":612,"value":872},{"type":606,"tag":636,"props":3624,"children":3625},{"style":684},[3626],{"type":612,"value":724},{"type":606,"tag":636,"props":3628,"children":3629},{"style":648},[3630],{"type":612,"value":3631},",    ",{"type":606,"tag":636,"props":3633,"children":3634},{"style":665},[3635],{"type":612,"value":3636},"# 555.123.4567\n",{"type":606,"tag":636,"props":3638,"children":3639},{"class":638,"line":199},[3640,3644,3648,3652,3657,3661],{"type":606,"tag":636,"props":3641,"children":3642},{"style":642},[3643],{"type":612,"value":3468},{"type":606,"tag":636,"props":3645,"children":3646},{"style":684},[3647],{"type":612,"value":724},{"type":606,"tag":636,"props":3649,"children":3650},{"style":727},[3651],{"type":612,"value":839},{"type":606,"tag":636,"props":3653,"children":3654},{"style":642},[3655],{"type":612,"value":3656},"{10}",{"type":606,"tag":636,"props":3658,"children":3659},{"style":684},[3660],{"type":612,"value":724},{"type":606,"tag":636,"props":3662,"children":3663},{"style":665},[3664],{"type":612,"value":3665},"                   # 5551234567\n",{"type":606,"tag":636,"props":3667,"children":3668},{"class":638,"line":208},[3669],{"type":606,"tag":636,"props":3670,"children":3671},{"style":648},[3672],{"type":612,"value":3673},"    ]\n",{"type":606,"tag":636,"props":3675,"children":3676},{"class":638,"line":217},[3677],{"type":606,"tag":636,"props":3678,"children":3679},{"style":648},[3680],{"type":612,"value":3077},{"type":606,"tag":636,"props":3682,"children":3683},{"class":638,"line":227},[3684,3689,3693],{"type":606,"tag":636,"props":3685,"children":3686},{"style":648},[3687],{"type":612,"value":3688},"    phones ",{"type":606,"tag":636,"props":3690,"children":3691},{"style":642},[3692],{"type":612,"value":681},{"type":606,"tag":636,"props":3694,"children":3695},{"style":648},[3696],{"type":612,"value":3697}," []\n",{"type":606,"tag":636,"props":3699,"children":3700},{"class":638,"line":236},[3701,3706,3711,3715],{"type":606,"tag":636,"props":3702,"children":3703},{"style":642},[3704],{"type":612,"value":3705},"    for",{"type":606,"tag":636,"props":3707,"children":3708},{"style":648},[3709],{"type":612,"value":3710}," pattern ",{"type":606,"tag":636,"props":3712,"children":3713},{"style":642},[3714],{"type":612,"value":2775},{"type":606,"tag":636,"props":3716,"children":3717},{"style":648},[3718],{"type":612,"value":3719}," patterns:\n",{"type":606,"tag":636,"props":3721,"children":3722},{"class":638,"line":245},[3723],{"type":606,"tag":636,"props":3724,"children":3725},{"style":648},[3726],{"type":612,"value":3727},"        phones.extend(re.findall(pattern, text))\n",{"type":606,"tag":636,"props":3729,"children":3730},{"class":638,"line":254},[3731,3735],{"type":606,"tag":636,"props":3732,"children":3733},{"style":642},[3734],{"type":612,"value":2552},{"type":606,"tag":636,"props":3736,"children":3737},{"style":648},[3738],{"type":612,"value":3739}," phones\n",{"type":606,"tag":636,"props":3741,"children":3742},{"class":638,"line":263},[3743],{"type":606,"tag":636,"props":3744,"children":3745},{"emptyLinePlaceholder":13},[3746],{"type":612,"value":659},{"type":606,"tag":636,"props":3748,"children":3749},{"class":638,"line":272},[3750],{"type":606,"tag":636,"props":3751,"children":3752},{"style":665},[3753],{"type":612,"value":3754},"# Test phone formatting\n",{"type":606,"tag":636,"props":3756,"children":3757},{"class":638,"line":281},[3758,3763,3767],{"type":606,"tag":636,"props":3759,"children":3760},{"style":648},[3761],{"type":612,"value":3762},"phone_numbers ",{"type":606,"tag":636,"props":3764,"children":3765},{"style":642},[3766],{"type":612,"value":681},{"type":606,"tag":636,"props":3768,"children":3769},{"style":648},[3770],{"type":612,"value":2697},{"type":606,"tag":636,"props":3772,"children":3773},{"class":638,"line":291},[3774,3779],{"type":606,"tag":636,"props":3775,"children":3776},{"style":684},[3777],{"type":612,"value":3778},"    \"5551234567\"",{"type":606,"tag":636,"props":3780,"children":3781},{"style":648},[3782],{"type":612,"value":2710},{"type":606,"tag":636,"props":3784,"children":3785},{"class":638,"line":302},[3786,3791],{"type":606,"tag":636,"props":3787,"children":3788},{"style":684},[3789],{"type":612,"value":3790},"    \"1-555-123-4567\"",{"type":606,"tag":636,"props":3792,"children":3793},{"style":648},[3794],{"type":612,"value":2710},{"type":606,"tag":636,"props":3796,"children":3797},{"class":638,"line":311},[3798,3803],{"type":606,"tag":636,"props":3799,"children":3800},{"style":684},[3801],{"type":612,"value":3802},"    \"(555) 123-4567\"",{"type":606,"tag":636,"props":3804,"children":3805},{"style":648},[3806],{"type":612,"value":2710},{"type":606,"tag":636,"props":3808,"children":3809},{"class":638,"line":320},[3810],{"type":606,"tag":636,"props":3811,"children":3812},{"style":684},[3813],{"type":612,"value":3814},"    \"555.123.4567\"\n",{"type":606,"tag":636,"props":3816,"children":3817},{"class":638,"line":329},[3818],{"type":606,"tag":636,"props":3819,"children":3820},{"style":648},[3821],{"type":612,"value":2750},{"type":606,"tag":636,"props":3823,"children":3824},{"class":638,"line":338},[3825],{"type":606,"tag":636,"props":3826,"children":3827},{"emptyLinePlaceholder":13},[3828],{"type":612,"value":659},{"type":606,"tag":636,"props":3830,"children":3831},{"class":638,"line":347},[3832,3836,3841,3845],{"type":606,"tag":636,"props":3833,"children":3834},{"style":642},[3835],{"type":612,"value":2765},{"type":606,"tag":636,"props":3837,"children":3838},{"style":648},[3839],{"type":612,"value":3840}," phone ",{"type":606,"tag":636,"props":3842,"children":3843},{"style":642},[3844],{"type":612,"value":2775},{"type":606,"tag":636,"props":3846,"children":3847},{"style":648},[3848],{"type":612,"value":3849}," phone_numbers:\n",{"type":606,"tag":636,"props":3851,"children":3852},{"class":638,"line":356},[3853,3858,3862],{"type":606,"tag":636,"props":3854,"children":3855},{"style":648},[3856],{"type":612,"value":3857},"    formatted ",{"type":606,"tag":636,"props":3859,"children":3860},{"style":642},[3861],{"type":612,"value":681},{"type":606,"tag":636,"props":3863,"children":3864},{"style":648},[3865],{"type":612,"value":3866}," format_phone(phone)\n",{"type":606,"tag":636,"props":3868,"children":3869},{"class":638,"line":367},[3870,3874,3878,3882,3886,3890,3895,3899,3904,3908,3913,3917,3921],{"type":606,"tag":636,"props":3871,"children":3872},{"style":727},[3873],{"type":612,"value":1556},{"type":606,"tag":636,"props":3875,"children":3876},{"style":648},[3877],{"type":612,"value":913},{"type":606,"tag":636,"props":3879,"children":3880},{"style":642},[3881],{"type":612,"value":918},{"type":606,"tag":636,"props":3883,"children":3884},{"style":684},[3885],{"type":612,"value":943},{"type":606,"tag":636,"props":3887,"children":3888},{"style":727},[3889],{"type":612,"value":928},{"type":606,"tag":636,"props":3891,"children":3892},{"style":648},[3893],{"type":612,"value":3894},"phone",{"type":606,"tag":636,"props":3896,"children":3897},{"style":727},[3898],{"type":612,"value":938},{"type":606,"tag":636,"props":3900,"children":3901},{"style":684},[3902],{"type":612,"value":3903}," → ",{"type":606,"tag":636,"props":3905,"children":3906},{"style":727},[3907],{"type":612,"value":928},{"type":606,"tag":636,"props":3909,"children":3910},{"style":648},[3911],{"type":612,"value":3912},"formatted",{"type":606,"tag":636,"props":3914,"children":3915},{"style":727},[3916],{"type":612,"value":938},{"type":606,"tag":636,"props":3918,"children":3919},{"style":684},[3920],{"type":612,"value":943},{"type":606,"tag":636,"props":3922,"children":3923},{"style":648},[3924],{"type":612,"value":948},{"type":606,"tag":636,"props":3926,"children":3927},{"class":638,"line":376},[3928],{"type":606,"tag":636,"props":3929,"children":3930},{"emptyLinePlaceholder":13},[3931],{"type":612,"value":659},{"type":606,"tag":636,"props":3933,"children":3934},{"class":638,"line":385},[3935],{"type":606,"tag":636,"props":3936,"children":3937},{"style":665},[3938],{"type":612,"value":3939},"# Extract from text\n",{"type":606,"tag":636,"props":3941,"children":3942},{"class":638,"line":394},[3943,3947,3951],{"type":606,"tag":636,"props":3944,"children":3945},{"style":648},[3946],{"type":612,"value":676},{"type":606,"tag":636,"props":3948,"children":3949},{"style":642},[3950],{"type":612,"value":681},{"type":606,"tag":636,"props":3952,"children":3953},{"style":684},[3954],{"type":612,"value":3955}," \"Call (555) 123-4567 or 555.987.6543 for support\"\n",{"type":606,"tag":636,"props":3957,"children":3958},{"class":638,"line":403},[3959,3964,3968],{"type":606,"tag":636,"props":3960,"children":3961},{"style":648},[3962],{"type":612,"value":3963},"found_phones ",{"type":606,"tag":636,"props":3965,"children":3966},{"style":642},[3967],{"type":612,"value":681},{"type":606,"tag":636,"props":3969,"children":3970},{"style":648},[3971],{"type":612,"value":3972}," extract_phone_numbers(text)\n",{"type":606,"tag":636,"props":3974,"children":3975},{"class":638,"line":412},[3976,3980,3984,3988,3992,3996,4001,4005,4009],{"type":606,"tag":636,"props":3977,"children":3978},{"style":727},[3979],{"type":612,"value":908},{"type":606,"tag":636,"props":3981,"children":3982},{"style":648},[3983],{"type":612,"value":913},{"type":606,"tag":636,"props":3985,"children":3986},{"style":642},[3987],{"type":612,"value":918},{"type":606,"tag":636,"props":3989,"children":3990},{"style":684},[3991],{"type":612,"value":968},{"type":606,"tag":636,"props":3993,"children":3994},{"style":727},[3995],{"type":612,"value":928},{"type":606,"tag":636,"props":3997,"children":3998},{"style":648},[3999],{"type":612,"value":4000},"found_phones",{"type":606,"tag":636,"props":4002,"children":4003},{"style":727},[4004],{"type":612,"value":938},{"type":606,"tag":636,"props":4006,"children":4007},{"style":684},[4008],{"type":612,"value":943},{"type":606,"tag":636,"props":4010,"children":4011},{"style":648},[4012],{"type":612,"value":948},{"type":606,"tag":1230,"props":4014,"children":4016},{"id":4015},"url-and-file-path-processing",[4017],{"type":612,"value":4018},"URL and File Path Processing",{"type":606,"tag":621,"props":4020,"children":4021},{},[4022],{"type":606,"tag":625,"props":4023,"children":4025},{"className":627,"code":4024,"language":629,"meta":8,"style":8},"import re\n\ndef extract_urls(text):\n    # Simple URL pattern\n    pattern = r'https?://[^\\s\u003C>\"{}|\\\\^`\\[\\]]+'\n    return re.findall(pattern, text)\n\ndef parse_filename(filepath):\n    # Extract filename components\n    pattern = r'(.*/)?([^/]+?)(\\.[^.]*)?$'\n    match = re.match(pattern, filepath)\n    \n    if match:\n        return {\n            'path': match.group(1) or '',\n            'name': match.group(2),\n            'extension': match.group(3) or ''\n        }\n    return None\n\ndef clean_filename(filename):\n    # Remove invalid characters for filenames\n    cleaned = re.sub(r'[\u003C>:\"/\\\\|?*]', '_', filename)\n    # Remove multiple underscores\n    cleaned = re.sub(r'_{2,}', '_', cleaned)\n    return cleaned.strip('_')\n\n# Test URL extraction\ntext = \"Visit https://example.com or http://test.org for more info\"\nurls = extract_urls(text)\nprint(f\"Found URLs: {urls}\")\n\n# Test filename parsing\nfilepaths = [\n    \"/home/user/document.pdf\",\n    \"image.jpg\",\n    \"/path/to/file\",\n    \"archive.tar.gz\"\n]\n\nfor filepath in filepaths:\n    parsed = parse_filename(filepath)\n    print(f\"{filepath} → {parsed}\")\n\n# Test filename cleaning\ndirty_names = [\n    \"My Document \u003Cversion 2>.pdf\",\n    \"file/with\\\\bad:chars.txt\",\n    \"normal_filename.doc\"\n]\n\nfor name in dirty_names:\n    clean = clean_filename(name)\n    print(f\"'{name}' → '{clean}'\")\n",[4026],{"type":606,"tag":632,"props":4027,"children":4028},{"__ignoreMap":8},[4029,4040,4047,4063,4071,4146,4157,4164,4181,4189,4291,4308,4315,4327,4339,4374,4396,4425,4433,4444,4451,4468,4476,4532,4540,4589,4609,4616,4624,4640,4657,4698,4705,4713,4729,4741,4753,4765,4773,4780,4787,4808,4825,4882,4889,4897,4913,4925,4946,4954,4961,4968,4989,5006],{"type":606,"tag":636,"props":4030,"children":4031},{"class":638,"line":12},[4032,4036],{"type":606,"tag":636,"props":4033,"children":4034},{"style":642},[4035],{"type":612,"value":645},{"type":606,"tag":636,"props":4037,"children":4038},{"style":648},[4039],{"type":612,"value":651},{"type":606,"tag":636,"props":4041,"children":4042},{"class":638,"line":27},[4043],{"type":606,"tag":636,"props":4044,"children":4045},{"emptyLinePlaceholder":13},[4046],{"type":612,"value":659},{"type":606,"tag":636,"props":4048,"children":4049},{"class":638,"line":36},[4050,4054,4059],{"type":606,"tag":636,"props":4051,"children":4052},{"style":642},[4053],{"type":612,"value":2469},{"type":606,"tag":636,"props":4055,"children":4056},{"style":2472},[4057],{"type":612,"value":4058}," extract_urls",{"type":606,"tag":636,"props":4060,"children":4061},{"style":648},[4062],{"type":612,"value":2594},{"type":606,"tag":636,"props":4064,"children":4065},{"class":638,"line":45},[4066],{"type":606,"tag":636,"props":4067,"children":4068},{"style":665},[4069],{"type":612,"value":4070},"    # Simple URL pattern\n",{"type":606,"tag":636,"props":4072,"children":4073},{"class":638,"line":54},[4074,4078,4082,4086,4090,4095,4099,4104,4109,4114,4119,4124,4129,4134,4138,4142],{"type":606,"tag":636,"props":4075,"children":4076},{"style":648},[4077],{"type":612,"value":2488},{"type":606,"tag":636,"props":4079,"children":4080},{"style":642},[4081],{"type":612,"value":681},{"type":606,"tag":636,"props":4083,"children":4084},{"style":642},[4085],{"type":612,"value":719},{"type":606,"tag":636,"props":4087,"children":4088},{"style":684},[4089],{"type":612,"value":724},{"type":606,"tag":636,"props":4091,"children":4092},{"style":738},[4093],{"type":612,"value":4094},"https",{"type":606,"tag":636,"props":4096,"children":4097},{"style":642},[4098],{"type":612,"value":2349},{"type":606,"tag":636,"props":4100,"children":4101},{"style":738},[4102],{"type":612,"value":4103},"://",{"type":606,"tag":636,"props":4105,"children":4106},{"style":727},[4107],{"type":612,"value":4108},"[",{"type":606,"tag":636,"props":4110,"children":4111},{"style":642},[4112],{"type":612,"value":4113},"^",{"type":606,"tag":636,"props":4115,"children":4116},{"style":727},[4117],{"type":612,"value":4118},"\\s\u003C>\"{}|",{"type":606,"tag":636,"props":4120,"children":4121},{"style":753},[4122],{"type":612,"value":4123},"\\\\",{"type":606,"tag":636,"props":4125,"children":4126},{"style":727},[4127],{"type":612,"value":4128},"^`",{"type":606,"tag":636,"props":4130,"children":4131},{"style":753},[4132],{"type":612,"value":4133},"\\[\\]",{"type":606,"tag":636,"props":4135,"children":4136},{"style":727},[4137],{"type":612,"value":3155},{"type":606,"tag":636,"props":4139,"children":4140},{"style":642},[4141],{"type":612,"value":735},{"type":606,"tag":636,"props":4143,"children":4144},{"style":684},[4145],{"type":612,"value":776},{"type":606,"tag":636,"props":4147,"children":4148},{"class":638,"line":63},[4149,4153],{"type":606,"tag":636,"props":4150,"children":4151},{"style":642},[4152],{"type":612,"value":2552},{"type":606,"tag":636,"props":4154,"children":4155},{"style":648},[4156],{"type":612,"value":2665},{"type":606,"tag":636,"props":4158,"children":4159},{"class":638,"line":72},[4160],{"type":606,"tag":636,"props":4161,"children":4162},{"emptyLinePlaceholder":13},[4163],{"type":612,"value":659},{"type":606,"tag":636,"props":4165,"children":4166},{"class":638,"line":81},[4167,4171,4176],{"type":606,"tag":636,"props":4168,"children":4169},{"style":642},[4170],{"type":612,"value":2469},{"type":606,"tag":636,"props":4172,"children":4173},{"style":2472},[4174],{"type":612,"value":4175}," parse_filename",{"type":606,"tag":636,"props":4177,"children":4178},{"style":648},[4179],{"type":612,"value":4180},"(filepath):\n",{"type":606,"tag":636,"props":4182,"children":4183},{"class":638,"line":796},[4184],{"type":606,"tag":636,"props":4185,"children":4186},{"style":665},[4187],{"type":612,"value":4188},"    # Extract filename components\n",{"type":606,"tag":636,"props":4190,"children":4191},{"class":638,"line":99},[4192,4196,4200,4204,4208,4213,4217,4222,4226,4230,4235,4239,4244,4249,4254,4258,4262,4266,4271,4275,4279,4283,4287],{"type":606,"tag":636,"props":4193,"children":4194},{"style":648},[4195],{"type":612,"value":2488},{"type":606,"tag":636,"props":4197,"children":4198},{"style":642},[4199],{"type":612,"value":681},{"type":606,"tag":636,"props":4201,"children":4202},{"style":642},[4203],{"type":612,"value":719},{"type":606,"tag":636,"props":4205,"children":4206},{"style":684},[4207],{"type":612,"value":724},{"type":606,"tag":636,"props":4209,"children":4210},{"style":727},[4211],{"type":612,"value":4212},"(.",{"type":606,"tag":636,"props":4214,"children":4215},{"style":642},[4216],{"type":612,"value":2294},{"type":606,"tag":636,"props":4218,"children":4219},{"style":738},[4220],{"type":612,"value":4221},"/",{"type":606,"tag":636,"props":4223,"children":4224},{"style":727},[4225],{"type":612,"value":1915},{"type":606,"tag":636,"props":4227,"children":4228},{"style":642},[4229],{"type":612,"value":2349},{"type":606,"tag":636,"props":4231,"children":4232},{"style":727},[4233],{"type":612,"value":4234},"([",{"type":606,"tag":636,"props":4236,"children":4237},{"style":642},[4238],{"type":612,"value":4113},{"type":606,"tag":636,"props":4240,"children":4241},{"style":727},[4242],{"type":612,"value":4243},"/]",{"type":606,"tag":636,"props":4245,"children":4246},{"style":642},[4247],{"type":612,"value":4248},"+?",{"type":606,"tag":636,"props":4250,"children":4251},{"style":727},[4252],{"type":612,"value":4253},")(",{"type":606,"tag":636,"props":4255,"children":4256},{"style":753},[4257],{"type":612,"value":756},{"type":606,"tag":636,"props":4259,"children":4260},{"style":727},[4261],{"type":612,"value":4108},{"type":606,"tag":636,"props":4263,"children":4264},{"style":642},[4265],{"type":612,"value":4113},{"type":606,"tag":636,"props":4267,"children":4268},{"style":727},[4269],{"type":612,"value":4270},".]",{"type":606,"tag":636,"props":4272,"children":4273},{"style":642},[4274],{"type":612,"value":2294},{"type":606,"tag":636,"props":4276,"children":4277},{"style":727},[4278],{"type":612,"value":1915},{"type":606,"tag":636,"props":4280,"children":4281},{"style":642},[4282],{"type":612,"value":2349},{"type":606,"tag":636,"props":4284,"children":4285},{"style":727},[4286],{"type":612,"value":2540},{"type":606,"tag":636,"props":4288,"children":4289},{"style":684},[4290],{"type":612,"value":776},{"type":606,"tag":636,"props":4292,"children":4293},{"class":638,"line":108},[4294,4299,4303],{"type":606,"tag":636,"props":4295,"children":4296},{"style":648},[4297],{"type":612,"value":4298},"    match ",{"type":606,"tag":636,"props":4300,"children":4301},{"style":642},[4302],{"type":612,"value":681},{"type":606,"tag":636,"props":4304,"children":4305},{"style":648},[4306],{"type":612,"value":4307}," re.match(pattern, filepath)\n",{"type":606,"tag":636,"props":4309,"children":4310},{"class":638,"line":117},[4311],{"type":606,"tag":636,"props":4312,"children":4313},{"style":648},[4314],{"type":612,"value":3077},{"type":606,"tag":636,"props":4316,"children":4317},{"class":638,"line":126},[4318,4322],{"type":606,"tag":636,"props":4319,"children":4320},{"style":642},[4321],{"type":612,"value":3093},{"type":606,"tag":636,"props":4323,"children":4324},{"style":648},[4325],{"type":612,"value":4326}," match:\n",{"type":606,"tag":636,"props":4328,"children":4329},{"class":638,"line":135},[4330,4334],{"type":606,"tag":636,"props":4331,"children":4332},{"style":642},[4333],{"type":612,"value":3126},{"type":606,"tag":636,"props":4335,"children":4336},{"style":648},[4337],{"type":612,"value":4338}," {\n",{"type":606,"tag":636,"props":4340,"children":4341},{"class":638,"line":144},[4342,4347,4352,4356,4360,4365,4370],{"type":606,"tag":636,"props":4343,"children":4344},{"style":684},[4345],{"type":612,"value":4346},"            'path'",{"type":606,"tag":636,"props":4348,"children":4349},{"style":648},[4350],{"type":612,"value":4351},": match.group(",{"type":606,"tag":636,"props":4353,"children":4354},{"style":727},[4355],{"type":612,"value":3311},{"type":606,"tag":636,"props":4357,"children":4358},{"style":648},[4359],{"type":612,"value":3164},{"type":606,"tag":636,"props":4361,"children":4362},{"style":642},[4363],{"type":612,"value":4364},"or",{"type":606,"tag":636,"props":4366,"children":4367},{"style":684},[4368],{"type":612,"value":4369}," ''",{"type":606,"tag":636,"props":4371,"children":4372},{"style":648},[4373],{"type":612,"value":2710},{"type":606,"tag":636,"props":4375,"children":4376},{"class":638,"line":153},[4377,4382,4386,4391],{"type":606,"tag":636,"props":4378,"children":4379},{"style":684},[4380],{"type":612,"value":4381},"            'name'",{"type":606,"tag":636,"props":4383,"children":4384},{"style":648},[4385],{"type":612,"value":4351},{"type":606,"tag":636,"props":4387,"children":4388},{"style":727},[4389],{"type":612,"value":4390},"2",{"type":606,"tag":636,"props":4392,"children":4393},{"style":648},[4394],{"type":612,"value":4395},"),\n",{"type":606,"tag":636,"props":4397,"children":4398},{"class":638,"line":163},[4399,4404,4408,4412,4416,4420],{"type":606,"tag":636,"props":4400,"children":4401},{"style":684},[4402],{"type":612,"value":4403},"            'extension'",{"type":606,"tag":636,"props":4405,"children":4406},{"style":648},[4407],{"type":612,"value":4351},{"type":606,"tag":636,"props":4409,"children":4410},{"style":727},[4411],{"type":612,"value":3150},{"type":606,"tag":636,"props":4413,"children":4414},{"style":648},[4415],{"type":612,"value":3164},{"type":606,"tag":636,"props":4417,"children":4418},{"style":642},[4419],{"type":612,"value":4364},{"type":606,"tag":636,"props":4421,"children":4422},{"style":684},[4423],{"type":612,"value":4424}," ''\n",{"type":606,"tag":636,"props":4426,"children":4427},{"class":638,"line":172},[4428],{"type":606,"tag":636,"props":4429,"children":4430},{"style":648},[4431],{"type":612,"value":4432},"        }\n",{"type":606,"tag":636,"props":4434,"children":4435},{"class":638,"line":181},[4436,4440],{"type":606,"tag":636,"props":4437,"children":4438},{"style":642},[4439],{"type":612,"value":2552},{"type":606,"tag":636,"props":4441,"children":4442},{"style":727},[4443],{"type":612,"value":2570},{"type":606,"tag":636,"props":4445,"children":4446},{"class":638,"line":190},[4447],{"type":606,"tag":636,"props":4448,"children":4449},{"emptyLinePlaceholder":13},[4450],{"type":612,"value":659},{"type":606,"tag":636,"props":4452,"children":4453},{"class":638,"line":199},[4454,4458,4463],{"type":606,"tag":636,"props":4455,"children":4456},{"style":642},[4457],{"type":612,"value":2469},{"type":606,"tag":636,"props":4459,"children":4460},{"style":2472},[4461],{"type":612,"value":4462}," clean_filename",{"type":606,"tag":636,"props":4464,"children":4465},{"style":648},[4466],{"type":612,"value":4467},"(filename):\n",{"type":606,"tag":636,"props":4469,"children":4470},{"class":638,"line":208},[4471],{"type":606,"tag":636,"props":4472,"children":4473},{"style":665},[4474],{"type":612,"value":4475},"    # Remove invalid characters for filenames\n",{"type":606,"tag":636,"props":4477,"children":4478},{"class":638,"line":217},[4479,4484,4488,4492,4496,4500,4505,4509,4514,4518,4522,4527],{"type":606,"tag":636,"props":4480,"children":4481},{"style":648},[4482],{"type":612,"value":4483},"    cleaned ",{"type":606,"tag":636,"props":4485,"children":4486},{"style":642},[4487],{"type":612,"value":681},{"type":606,"tag":636,"props":4489,"children":4490},{"style":648},[4491],{"type":612,"value":1738},{"type":606,"tag":636,"props":4493,"children":4494},{"style":642},[4495],{"type":612,"value":1316},{"type":606,"tag":636,"props":4497,"children":4498},{"style":684},[4499],{"type":612,"value":724},{"type":606,"tag":636,"props":4501,"children":4502},{"style":727},[4503],{"type":612,"value":4504},"[\u003C>:\"/",{"type":606,"tag":636,"props":4506,"children":4507},{"style":753},[4508],{"type":612,"value":4123},{"type":606,"tag":636,"props":4510,"children":4511},{"style":727},[4512],{"type":612,"value":4513},"|?*]",{"type":606,"tag":636,"props":4515,"children":4516},{"style":684},[4517],{"type":612,"value":724},{"type":606,"tag":636,"props":4519,"children":4520},{"style":648},[4521],{"type":612,"value":1787},{"type":606,"tag":636,"props":4523,"children":4524},{"style":684},[4525],{"type":612,"value":4526},"'_'",{"type":606,"tag":636,"props":4528,"children":4529},{"style":648},[4530],{"type":612,"value":4531},", filename)\n",{"type":606,"tag":636,"props":4533,"children":4534},{"class":638,"line":227},[4535],{"type":606,"tag":636,"props":4536,"children":4537},{"style":665},[4538],{"type":612,"value":4539},"    # Remove multiple underscores\n",{"type":606,"tag":636,"props":4541,"children":4542},{"class":638,"line":236},[4543,4547,4551,4555,4559,4563,4568,4572,4576,4580,4584],{"type":606,"tag":636,"props":4544,"children":4545},{"style":648},[4546],{"type":612,"value":4483},{"type":606,"tag":636,"props":4548,"children":4549},{"style":642},[4550],{"type":612,"value":681},{"type":606,"tag":636,"props":4552,"children":4553},{"style":648},[4554],{"type":612,"value":1738},{"type":606,"tag":636,"props":4556,"children":4557},{"style":642},[4558],{"type":612,"value":1316},{"type":606,"tag":636,"props":4560,"children":4561},{"style":684},[4562],{"type":612,"value":724},{"type":606,"tag":636,"props":4564,"children":4565},{"style":738},[4566],{"type":612,"value":4567},"_",{"type":606,"tag":636,"props":4569,"children":4570},{"style":642},[4571],{"type":612,"value":766},{"type":606,"tag":636,"props":4573,"children":4574},{"style":684},[4575],{"type":612,"value":724},{"type":606,"tag":636,"props":4577,"children":4578},{"style":648},[4579],{"type":612,"value":1787},{"type":606,"tag":636,"props":4581,"children":4582},{"style":684},[4583],{"type":612,"value":4526},{"type":606,"tag":636,"props":4585,"children":4586},{"style":648},[4587],{"type":612,"value":4588},", cleaned)\n",{"type":606,"tag":636,"props":4590,"children":4591},{"class":638,"line":245},[4592,4596,4601,4605],{"type":606,"tag":636,"props":4593,"children":4594},{"style":642},[4595],{"type":612,"value":2552},{"type":606,"tag":636,"props":4597,"children":4598},{"style":648},[4599],{"type":612,"value":4600}," cleaned.strip(",{"type":606,"tag":636,"props":4602,"children":4603},{"style":684},[4604],{"type":612,"value":4526},{"type":606,"tag":636,"props":4606,"children":4607},{"style":648},[4608],{"type":612,"value":948},{"type":606,"tag":636,"props":4610,"children":4611},{"class":638,"line":254},[4612],{"type":606,"tag":636,"props":4613,"children":4614},{"emptyLinePlaceholder":13},[4615],{"type":612,"value":659},{"type":606,"tag":636,"props":4617,"children":4618},{"class":638,"line":263},[4619],{"type":606,"tag":636,"props":4620,"children":4621},{"style":665},[4622],{"type":612,"value":4623},"# Test URL extraction\n",{"type":606,"tag":636,"props":4625,"children":4626},{"class":638,"line":272},[4627,4631,4635],{"type":606,"tag":636,"props":4628,"children":4629},{"style":648},[4630],{"type":612,"value":676},{"type":606,"tag":636,"props":4632,"children":4633},{"style":642},[4634],{"type":612,"value":681},{"type":606,"tag":636,"props":4636,"children":4637},{"style":684},[4638],{"type":612,"value":4639}," \"Visit https://example.com or http://test.org for more info\"\n",{"type":606,"tag":636,"props":4641,"children":4642},{"class":638,"line":281},[4643,4648,4652],{"type":606,"tag":636,"props":4644,"children":4645},{"style":648},[4646],{"type":612,"value":4647},"urls ",{"type":606,"tag":636,"props":4649,"children":4650},{"style":642},[4651],{"type":612,"value":681},{"type":606,"tag":636,"props":4653,"children":4654},{"style":648},[4655],{"type":612,"value":4656}," extract_urls(text)\n",{"type":606,"tag":636,"props":4658,"children":4659},{"class":638,"line":291},[4660,4664,4668,4672,4677,4681,4686,4690,4694],{"type":606,"tag":636,"props":4661,"children":4662},{"style":727},[4663],{"type":612,"value":908},{"type":606,"tag":636,"props":4665,"children":4666},{"style":648},[4667],{"type":612,"value":913},{"type":606,"tag":636,"props":4669,"children":4670},{"style":642},[4671],{"type":612,"value":918},{"type":606,"tag":636,"props":4673,"children":4674},{"style":684},[4675],{"type":612,"value":4676},"\"Found URLs: ",{"type":606,"tag":636,"props":4678,"children":4679},{"style":727},[4680],{"type":612,"value":928},{"type":606,"tag":636,"props":4682,"children":4683},{"style":648},[4684],{"type":612,"value":4685},"urls",{"type":606,"tag":636,"props":4687,"children":4688},{"style":727},[4689],{"type":612,"value":938},{"type":606,"tag":636,"props":4691,"children":4692},{"style":684},[4693],{"type":612,"value":943},{"type":606,"tag":636,"props":4695,"children":4696},{"style":648},[4697],{"type":612,"value":948},{"type":606,"tag":636,"props":4699,"children":4700},{"class":638,"line":302},[4701],{"type":606,"tag":636,"props":4702,"children":4703},{"emptyLinePlaceholder":13},[4704],{"type":612,"value":659},{"type":606,"tag":636,"props":4706,"children":4707},{"class":638,"line":311},[4708],{"type":606,"tag":636,"props":4709,"children":4710},{"style":665},[4711],{"type":612,"value":4712},"# Test filename parsing\n",{"type":606,"tag":636,"props":4714,"children":4715},{"class":638,"line":320},[4716,4721,4725],{"type":606,"tag":636,"props":4717,"children":4718},{"style":648},[4719],{"type":612,"value":4720},"filepaths ",{"type":606,"tag":636,"props":4722,"children":4723},{"style":642},[4724],{"type":612,"value":681},{"type":606,"tag":636,"props":4726,"children":4727},{"style":648},[4728],{"type":612,"value":2697},{"type":606,"tag":636,"props":4730,"children":4731},{"class":638,"line":329},[4732,4737],{"type":606,"tag":636,"props":4733,"children":4734},{"style":684},[4735],{"type":612,"value":4736},"    \"/home/user/document.pdf\"",{"type":606,"tag":636,"props":4738,"children":4739},{"style":648},[4740],{"type":612,"value":2710},{"type":606,"tag":636,"props":4742,"children":4743},{"class":638,"line":338},[4744,4749],{"type":606,"tag":636,"props":4745,"children":4746},{"style":684},[4747],{"type":612,"value":4748},"    \"image.jpg\"",{"type":606,"tag":636,"props":4750,"children":4751},{"style":648},[4752],{"type":612,"value":2710},{"type":606,"tag":636,"props":4754,"children":4755},{"class":638,"line":347},[4756,4761],{"type":606,"tag":636,"props":4757,"children":4758},{"style":684},[4759],{"type":612,"value":4760},"    \"/path/to/file\"",{"type":606,"tag":636,"props":4762,"children":4763},{"style":648},[4764],{"type":612,"value":2710},{"type":606,"tag":636,"props":4766,"children":4767},{"class":638,"line":356},[4768],{"type":606,"tag":636,"props":4769,"children":4770},{"style":684},[4771],{"type":612,"value":4772},"    \"archive.tar.gz\"\n",{"type":606,"tag":636,"props":4774,"children":4775},{"class":638,"line":367},[4776],{"type":606,"tag":636,"props":4777,"children":4778},{"style":648},[4779],{"type":612,"value":2750},{"type":606,"tag":636,"props":4781,"children":4782},{"class":638,"line":376},[4783],{"type":606,"tag":636,"props":4784,"children":4785},{"emptyLinePlaceholder":13},[4786],{"type":612,"value":659},{"type":606,"tag":636,"props":4788,"children":4789},{"class":638,"line":385},[4790,4794,4799,4803],{"type":606,"tag":636,"props":4791,"children":4792},{"style":642},[4793],{"type":612,"value":2765},{"type":606,"tag":636,"props":4795,"children":4796},{"style":648},[4797],{"type":612,"value":4798}," filepath ",{"type":606,"tag":636,"props":4800,"children":4801},{"style":642},[4802],{"type":612,"value":2775},{"type":606,"tag":636,"props":4804,"children":4805},{"style":648},[4806],{"type":612,"value":4807}," filepaths:\n",{"type":606,"tag":636,"props":4809,"children":4810},{"class":638,"line":394},[4811,4816,4820],{"type":606,"tag":636,"props":4812,"children":4813},{"style":648},[4814],{"type":612,"value":4815},"    parsed ",{"type":606,"tag":636,"props":4817,"children":4818},{"style":642},[4819],{"type":612,"value":681},{"type":606,"tag":636,"props":4821,"children":4822},{"style":648},[4823],{"type":612,"value":4824}," parse_filename(filepath)\n",{"type":606,"tag":636,"props":4826,"children":4827},{"class":638,"line":403},[4828,4832,4836,4840,4844,4848,4853,4857,4861,4865,4870,4874,4878],{"type":606,"tag":636,"props":4829,"children":4830},{"style":727},[4831],{"type":612,"value":1556},{"type":606,"tag":636,"props":4833,"children":4834},{"style":648},[4835],{"type":612,"value":913},{"type":606,"tag":636,"props":4837,"children":4838},{"style":642},[4839],{"type":612,"value":918},{"type":606,"tag":636,"props":4841,"children":4842},{"style":684},[4843],{"type":612,"value":943},{"type":606,"tag":636,"props":4845,"children":4846},{"style":727},[4847],{"type":612,"value":928},{"type":606,"tag":636,"props":4849,"children":4850},{"style":648},[4851],{"type":612,"value":4852},"filepath",{"type":606,"tag":636,"props":4854,"children":4855},{"style":727},[4856],{"type":612,"value":938},{"type":606,"tag":636,"props":4858,"children":4859},{"style":684},[4860],{"type":612,"value":3903},{"type":606,"tag":636,"props":4862,"children":4863},{"style":727},[4864],{"type":612,"value":928},{"type":606,"tag":636,"props":4866,"children":4867},{"style":648},[4868],{"type":612,"value":4869},"parsed",{"type":606,"tag":636,"props":4871,"children":4872},{"style":727},[4873],{"type":612,"value":938},{"type":606,"tag":636,"props":4875,"children":4876},{"style":684},[4877],{"type":612,"value":943},{"type":606,"tag":636,"props":4879,"children":4880},{"style":648},[4881],{"type":612,"value":948},{"type":606,"tag":636,"props":4883,"children":4884},{"class":638,"line":412},[4885],{"type":606,"tag":636,"props":4886,"children":4887},{"emptyLinePlaceholder":13},[4888],{"type":612,"value":659},{"type":606,"tag":636,"props":4890,"children":4891},{"class":638,"line":423},[4892],{"type":606,"tag":636,"props":4893,"children":4894},{"style":665},[4895],{"type":612,"value":4896},"# Test filename cleaning\n",{"type":606,"tag":636,"props":4898,"children":4899},{"class":638,"line":432},[4900,4905,4909],{"type":606,"tag":636,"props":4901,"children":4902},{"style":648},[4903],{"type":612,"value":4904},"dirty_names ",{"type":606,"tag":636,"props":4906,"children":4907},{"style":642},[4908],{"type":612,"value":681},{"type":606,"tag":636,"props":4910,"children":4911},{"style":648},[4912],{"type":612,"value":2697},{"type":606,"tag":636,"props":4914,"children":4915},{"class":638,"line":441},[4916,4921],{"type":606,"tag":636,"props":4917,"children":4918},{"style":684},[4919],{"type":612,"value":4920},"    \"My Document \u003Cversion 2>.pdf\"",{"type":606,"tag":636,"props":4922,"children":4923},{"style":648},[4924],{"type":612,"value":2710},{"type":606,"tag":636,"props":4926,"children":4927},{"class":638,"line":450},[4928,4933,4937,4942],{"type":606,"tag":636,"props":4929,"children":4930},{"style":684},[4931],{"type":612,"value":4932},"    \"file/with",{"type":606,"tag":636,"props":4934,"children":4935},{"style":727},[4936],{"type":612,"value":4123},{"type":606,"tag":636,"props":4938,"children":4939},{"style":684},[4940],{"type":612,"value":4941},"bad:chars.txt\"",{"type":606,"tag":636,"props":4943,"children":4944},{"style":648},[4945],{"type":612,"value":2710},{"type":606,"tag":636,"props":4947,"children":4948},{"class":638,"line":459},[4949],{"type":606,"tag":636,"props":4950,"children":4951},{"style":684},[4952],{"type":612,"value":4953},"    \"normal_filename.doc\"\n",{"type":606,"tag":636,"props":4955,"children":4956},{"class":638,"line":468},[4957],{"type":606,"tag":636,"props":4958,"children":4959},{"style":648},[4960],{"type":612,"value":2750},{"type":606,"tag":636,"props":4962,"children":4963},{"class":638,"line":477},[4964],{"type":606,"tag":636,"props":4965,"children":4966},{"emptyLinePlaceholder":13},[4967],{"type":612,"value":659},{"type":606,"tag":636,"props":4969,"children":4970},{"class":638,"line":488},[4971,4975,4980,4984],{"type":606,"tag":636,"props":4972,"children":4973},{"style":642},[4974],{"type":612,"value":2765},{"type":606,"tag":636,"props":4976,"children":4977},{"style":648},[4978],{"type":612,"value":4979}," name ",{"type":606,"tag":636,"props":4981,"children":4982},{"style":642},[4983],{"type":612,"value":2775},{"type":606,"tag":636,"props":4985,"children":4986},{"style":648},[4987],{"type":612,"value":4988}," dirty_names:\n",{"type":606,"tag":636,"props":4990,"children":4991},{"class":638,"line":497},[4992,4997,5001],{"type":606,"tag":636,"props":4993,"children":4994},{"style":648},[4995],{"type":612,"value":4996},"    clean ",{"type":606,"tag":636,"props":4998,"children":4999},{"style":642},[5000],{"type":612,"value":681},{"type":606,"tag":636,"props":5002,"children":5003},{"style":648},[5004],{"type":612,"value":5005}," clean_filename(name)\n",{"type":606,"tag":636,"props":5007,"children":5008},{"class":638,"line":506},[5009,5013,5017,5021,5026,5030,5035,5039,5044,5048,5053,5057,5062],{"type":606,"tag":636,"props":5010,"children":5011},{"style":727},[5012],{"type":612,"value":1556},{"type":606,"tag":636,"props":5014,"children":5015},{"style":648},[5016],{"type":612,"value":913},{"type":606,"tag":636,"props":5018,"children":5019},{"style":642},[5020],{"type":612,"value":918},{"type":606,"tag":636,"props":5022,"children":5023},{"style":684},[5024],{"type":612,"value":5025},"\"'",{"type":606,"tag":636,"props":5027,"children":5028},{"style":727},[5029],{"type":612,"value":928},{"type":606,"tag":636,"props":5031,"children":5032},{"style":648},[5033],{"type":612,"value":5034},"name",{"type":606,"tag":636,"props":5036,"children":5037},{"style":727},[5038],{"type":612,"value":938},{"type":606,"tag":636,"props":5040,"children":5041},{"style":684},[5042],{"type":612,"value":5043},"' → '",{"type":606,"tag":636,"props":5045,"children":5046},{"style":727},[5047],{"type":612,"value":928},{"type":606,"tag":636,"props":5049,"children":5050},{"style":648},[5051],{"type":612,"value":5052},"clean",{"type":606,"tag":636,"props":5054,"children":5055},{"style":727},[5056],{"type":612,"value":938},{"type":606,"tag":636,"props":5058,"children":5059},{"style":684},[5060],{"type":612,"value":5061},"'\"",{"type":606,"tag":636,"props":5063,"children":5064},{"style":648},[5065],{"type":612,"value":948},{"type":606,"tag":1230,"props":5067,"children":5069},{"id":5068},"log-file-processing",[5070],{"type":612,"value":5071},"Log File Processing",{"type":606,"tag":621,"props":5073,"children":5074},{},[5075],{"type":606,"tag":625,"props":5076,"children":5078},{"className":627,"code":5077,"language":629,"meta":8,"style":8},"import re\nfrom datetime import datetime\n\ndef parse_log_entry(log_line):\n    # Parse common log format: timestamp [LEVEL] message\n    pattern = r'(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}) \\[(\\w+)\\] (.+)'\n    match = re.match(pattern, log_line)\n    \n    if match:\n        timestamp_str, level, message = match.groups()\n        return {\n            'timestamp': timestamp_str,\n            'level': level,\n            'message': message\n        }\n    return None\n\ndef extract_ip_addresses(text):\n    # IPv4 pattern\n    pattern = r'\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b'\n    return re.findall(pattern, text)\n\ndef find_error_codes(text):\n    # Common HTTP error codes\n    pattern = r'\\b[4-5]\\d{2}\\b'\n    return re.findall(pattern, text)\n\n# Sample log entries\nlog_entries = [\n    \"2024-01-15 10:30:45 [INFO] User 192.168.1.100 logged in\",\n    \"2024-01-15 10:31:12 [ERROR] 404 error for /missing-page\",\n    \"2024-01-15 10:31:45 [WARN] High CPU usage detected\"\n]\n\nprint(\"Parsed log entries:\")\nfor entry in log_entries:\n    parsed = parse_log_entry(entry)\n    if parsed:\n        print(f\"  {parsed['level']}: {parsed['message']}\")\n\n# Extract data from logs\nall_logs = \" \".join(log_entries)\nip_addresses = extract_ip_addresses(all_logs)\nerror_codes = find_error_codes(all_logs)\n\nprint(f\"\\nIP addresses found: {ip_addresses}\")\nprint(f\"Error codes found: {error_codes}\")\n",[5079],{"type":606,"tag":632,"props":5080,"children":5081},{"__ignoreMap":8},[5082,5093,5115,5122,5139,5147,5275,5291,5298,5309,5326,5337,5350,5363,5376,5383,5394,5401,5417,5425,5482,5493,5500,5516,5524,5560,5571,5578,5586,5602,5614,5626,5634,5641,5648,5668,5689,5705,5717,5793,5800,5808,5830,5847,5864,5871,5921],{"type":606,"tag":636,"props":5083,"children":5084},{"class":638,"line":12},[5085,5089],{"type":606,"tag":636,"props":5086,"children":5087},{"style":642},[5088],{"type":612,"value":645},{"type":606,"tag":636,"props":5090,"children":5091},{"style":648},[5092],{"type":612,"value":651},{"type":606,"tag":636,"props":5094,"children":5095},{"class":638,"line":27},[5096,5101,5106,5110],{"type":606,"tag":636,"props":5097,"children":5098},{"style":642},[5099],{"type":612,"value":5100},"from",{"type":606,"tag":636,"props":5102,"children":5103},{"style":648},[5104],{"type":612,"value":5105}," datetime ",{"type":606,"tag":636,"props":5107,"children":5108},{"style":642},[5109],{"type":612,"value":645},{"type":606,"tag":636,"props":5111,"children":5112},{"style":648},[5113],{"type":612,"value":5114}," datetime\n",{"type":606,"tag":636,"props":5116,"children":5117},{"class":638,"line":36},[5118],{"type":606,"tag":636,"props":5119,"children":5120},{"emptyLinePlaceholder":13},[5121],{"type":612,"value":659},{"type":606,"tag":636,"props":5123,"children":5124},{"class":638,"line":45},[5125,5129,5134],{"type":606,"tag":636,"props":5126,"children":5127},{"style":642},[5128],{"type":612,"value":2469},{"type":606,"tag":636,"props":5130,"children":5131},{"style":2472},[5132],{"type":612,"value":5133}," parse_log_entry",{"type":606,"tag":636,"props":5135,"children":5136},{"style":648},[5137],{"type":612,"value":5138},"(log_line):\n",{"type":606,"tag":636,"props":5140,"children":5141},{"class":638,"line":54},[5142],{"type":606,"tag":636,"props":5143,"children":5144},{"style":665},[5145],{"type":612,"value":5146},"    # Parse common log format: timestamp [LEVEL] message\n",{"type":606,"tag":636,"props":5148,"children":5149},{"class":638,"line":63},[5150,5154,5158,5162,5166,5171,5175,5179,5183,5188,5192,5196,5200,5204,5208,5212,5216,5220,5224,5228,5232,5236,5241,5245,5249,5253,5258,5263,5267,5271],{"type":606,"tag":636,"props":5151,"children":5152},{"style":648},[5153],{"type":612,"value":2488},{"type":606,"tag":636,"props":5155,"children":5156},{"style":642},[5157],{"type":612,"value":681},{"type":606,"tag":636,"props":5159,"children":5160},{"style":642},[5161],{"type":612,"value":719},{"type":606,"tag":636,"props":5163,"children":5164},{"style":684},[5165],{"type":612,"value":724},{"type":606,"tag":636,"props":5167,"children":5168},{"style":727},[5169],{"type":612,"value":5170},"(\\d",{"type":606,"tag":636,"props":5172,"children":5173},{"style":642},[5174],{"type":612,"value":872},{"type":606,"tag":636,"props":5176,"children":5177},{"style":738},[5178],{"type":612,"value":863},{"type":606,"tag":636,"props":5180,"children":5181},{"style":727},[5182],{"type":612,"value":839},{"type":606,"tag":636,"props":5184,"children":5185},{"style":642},[5186],{"type":612,"value":5187},"{2}",{"type":606,"tag":636,"props":5189,"children":5190},{"style":738},[5191],{"type":612,"value":863},{"type":606,"tag":636,"props":5193,"children":5194},{"style":727},[5195],{"type":612,"value":839},{"type":606,"tag":636,"props":5197,"children":5198},{"style":642},[5199],{"type":612,"value":5187},{"type":606,"tag":636,"props":5201,"children":5202},{"style":727},[5203],{"type":612,"value":854},{"type":606,"tag":636,"props":5205,"children":5206},{"style":642},[5207],{"type":612,"value":5187},{"type":606,"tag":636,"props":5209,"children":5210},{"style":738},[5211],{"type":612,"value":3182},{"type":606,"tag":636,"props":5213,"children":5214},{"style":727},[5215],{"type":612,"value":839},{"type":606,"tag":636,"props":5217,"children":5218},{"style":642},[5219],{"type":612,"value":5187},{"type":606,"tag":636,"props":5221,"children":5222},{"style":738},[5223],{"type":612,"value":3182},{"type":606,"tag":636,"props":5225,"children":5226},{"style":727},[5227],{"type":612,"value":839},{"type":606,"tag":636,"props":5229,"children":5230},{"style":642},[5231],{"type":612,"value":5187},{"type":606,"tag":636,"props":5233,"children":5234},{"style":727},[5235],{"type":612,"value":1915},{"type":606,"tag":636,"props":5237,"children":5238},{"style":753},[5239],{"type":612,"value":5240}," \\[",{"type":606,"tag":636,"props":5242,"children":5243},{"style":727},[5244],{"type":612,"value":1906},{"type":606,"tag":636,"props":5246,"children":5247},{"style":642},[5248],{"type":612,"value":735},{"type":606,"tag":636,"props":5250,"children":5251},{"style":727},[5252],{"type":612,"value":1915},{"type":606,"tag":636,"props":5254,"children":5255},{"style":753},[5256],{"type":612,"value":5257},"\\]",{"type":606,"tag":636,"props":5259,"children":5260},{"style":727},[5261],{"type":612,"value":5262}," (.",{"type":606,"tag":636,"props":5264,"children":5265},{"style":642},[5266],{"type":612,"value":735},{"type":606,"tag":636,"props":5268,"children":5269},{"style":727},[5270],{"type":612,"value":1915},{"type":606,"tag":636,"props":5272,"children":5273},{"style":684},[5274],{"type":612,"value":776},{"type":606,"tag":636,"props":5276,"children":5277},{"class":638,"line":72},[5278,5282,5286],{"type":606,"tag":636,"props":5279,"children":5280},{"style":648},[5281],{"type":612,"value":4298},{"type":606,"tag":636,"props":5283,"children":5284},{"style":642},[5285],{"type":612,"value":681},{"type":606,"tag":636,"props":5287,"children":5288},{"style":648},[5289],{"type":612,"value":5290}," re.match(pattern, log_line)\n",{"type":606,"tag":636,"props":5292,"children":5293},{"class":638,"line":81},[5294],{"type":606,"tag":636,"props":5295,"children":5296},{"style":648},[5297],{"type":612,"value":3077},{"type":606,"tag":636,"props":5299,"children":5300},{"class":638,"line":796},[5301,5305],{"type":606,"tag":636,"props":5302,"children":5303},{"style":642},[5304],{"type":612,"value":3093},{"type":606,"tag":636,"props":5306,"children":5307},{"style":648},[5308],{"type":612,"value":4326},{"type":606,"tag":636,"props":5310,"children":5311},{"class":638,"line":99},[5312,5317,5321],{"type":606,"tag":636,"props":5313,"children":5314},{"style":648},[5315],{"type":612,"value":5316},"        timestamp_str, level, message ",{"type":606,"tag":636,"props":5318,"children":5319},{"style":642},[5320],{"type":612,"value":681},{"type":606,"tag":636,"props":5322,"children":5323},{"style":648},[5324],{"type":612,"value":5325}," match.groups()\n",{"type":606,"tag":636,"props":5327,"children":5328},{"class":638,"line":108},[5329,5333],{"type":606,"tag":636,"props":5330,"children":5331},{"style":642},[5332],{"type":612,"value":3126},{"type":606,"tag":636,"props":5334,"children":5335},{"style":648},[5336],{"type":612,"value":4338},{"type":606,"tag":636,"props":5338,"children":5339},{"class":638,"line":117},[5340,5345],{"type":606,"tag":636,"props":5341,"children":5342},{"style":684},[5343],{"type":612,"value":5344},"            'timestamp'",{"type":606,"tag":636,"props":5346,"children":5347},{"style":648},[5348],{"type":612,"value":5349},": timestamp_str,\n",{"type":606,"tag":636,"props":5351,"children":5352},{"class":638,"line":126},[5353,5358],{"type":606,"tag":636,"props":5354,"children":5355},{"style":684},[5356],{"type":612,"value":5357},"            'level'",{"type":606,"tag":636,"props":5359,"children":5360},{"style":648},[5361],{"type":612,"value":5362},": level,\n",{"type":606,"tag":636,"props":5364,"children":5365},{"class":638,"line":135},[5366,5371],{"type":606,"tag":636,"props":5367,"children":5368},{"style":684},[5369],{"type":612,"value":5370},"            'message'",{"type":606,"tag":636,"props":5372,"children":5373},{"style":648},[5374],{"type":612,"value":5375},": message\n",{"type":606,"tag":636,"props":5377,"children":5378},{"class":638,"line":144},[5379],{"type":606,"tag":636,"props":5380,"children":5381},{"style":648},[5382],{"type":612,"value":4432},{"type":606,"tag":636,"props":5384,"children":5385},{"class":638,"line":153},[5386,5390],{"type":606,"tag":636,"props":5387,"children":5388},{"style":642},[5389],{"type":612,"value":2552},{"type":606,"tag":636,"props":5391,"children":5392},{"style":727},[5393],{"type":612,"value":2570},{"type":606,"tag":636,"props":5395,"children":5396},{"class":638,"line":163},[5397],{"type":606,"tag":636,"props":5398,"children":5399},{"emptyLinePlaceholder":13},[5400],{"type":612,"value":659},{"type":606,"tag":636,"props":5402,"children":5403},{"class":638,"line":172},[5404,5408,5413],{"type":606,"tag":636,"props":5405,"children":5406},{"style":642},[5407],{"type":612,"value":2469},{"type":606,"tag":636,"props":5409,"children":5410},{"style":2472},[5411],{"type":612,"value":5412}," extract_ip_addresses",{"type":606,"tag":636,"props":5414,"children":5415},{"style":648},[5416],{"type":612,"value":2594},{"type":606,"tag":636,"props":5418,"children":5419},{"class":638,"line":181},[5420],{"type":606,"tag":636,"props":5421,"children":5422},{"style":665},[5423],{"type":612,"value":5424},"    # IPv4 pattern\n",{"type":606,"tag":636,"props":5426,"children":5427},{"class":638,"line":190},[5428,5432,5436,5440,5444,5449,5454,5458,5462,5466,5470,5474,5478],{"type":606,"tag":636,"props":5429,"children":5430},{"style":648},[5431],{"type":612,"value":2488},{"type":606,"tag":636,"props":5433,"children":5434},{"style":642},[5435],{"type":612,"value":681},{"type":606,"tag":636,"props":5437,"children":5438},{"style":642},[5439],{"type":612,"value":719},{"type":606,"tag":636,"props":5441,"children":5442},{"style":684},[5443],{"type":612,"value":724},{"type":606,"tag":636,"props":5445,"children":5446},{"style":727},[5447],{"type":612,"value":5448},"\\b(?:\\d",{"type":606,"tag":636,"props":5450,"children":5451},{"style":642},[5452],{"type":612,"value":5453},"{1,3}",{"type":606,"tag":636,"props":5455,"children":5456},{"style":753},[5457],{"type":612,"value":756},{"type":606,"tag":636,"props":5459,"children":5460},{"style":727},[5461],{"type":612,"value":1915},{"type":606,"tag":636,"props":5463,"children":5464},{"style":642},[5465],{"type":612,"value":844},{"type":606,"tag":636,"props":5467,"children":5468},{"style":727},[5469],{"type":612,"value":839},{"type":606,"tag":636,"props":5471,"children":5472},{"style":642},[5473],{"type":612,"value":5453},{"type":606,"tag":636,"props":5475,"children":5476},{"style":727},[5477],{"type":612,"value":771},{"type":606,"tag":636,"props":5479,"children":5480},{"style":684},[5481],{"type":612,"value":776},{"type":606,"tag":636,"props":5483,"children":5484},{"class":638,"line":199},[5485,5489],{"type":606,"tag":636,"props":5486,"children":5487},{"style":642},[5488],{"type":612,"value":2552},{"type":606,"tag":636,"props":5490,"children":5491},{"style":648},[5492],{"type":612,"value":2665},{"type":606,"tag":636,"props":5494,"children":5495},{"class":638,"line":208},[5496],{"type":606,"tag":636,"props":5497,"children":5498},{"emptyLinePlaceholder":13},[5499],{"type":612,"value":659},{"type":606,"tag":636,"props":5501,"children":5502},{"class":638,"line":217},[5503,5507,5512],{"type":606,"tag":636,"props":5504,"children":5505},{"style":642},[5506],{"type":612,"value":2469},{"type":606,"tag":636,"props":5508,"children":5509},{"style":2472},[5510],{"type":612,"value":5511}," find_error_codes",{"type":606,"tag":636,"props":5513,"children":5514},{"style":648},[5515],{"type":612,"value":2594},{"type":606,"tag":636,"props":5517,"children":5518},{"class":638,"line":227},[5519],{"type":606,"tag":636,"props":5520,"children":5521},{"style":665},[5522],{"type":612,"value":5523},"    # Common HTTP error codes\n",{"type":606,"tag":636,"props":5525,"children":5526},{"class":638,"line":236},[5527,5531,5535,5539,5543,5548,5552,5556],{"type":606,"tag":636,"props":5528,"children":5529},{"style":648},[5530],{"type":612,"value":2488},{"type":606,"tag":636,"props":5532,"children":5533},{"style":642},[5534],{"type":612,"value":681},{"type":606,"tag":636,"props":5536,"children":5537},{"style":642},[5538],{"type":612,"value":719},{"type":606,"tag":636,"props":5540,"children":5541},{"style":684},[5542],{"type":612,"value":724},{"type":606,"tag":636,"props":5544,"children":5545},{"style":727},[5546],{"type":612,"value":5547},"\\b[4-5]\\d",{"type":606,"tag":636,"props":5549,"children":5550},{"style":642},[5551],{"type":612,"value":5187},{"type":606,"tag":636,"props":5553,"children":5554},{"style":727},[5555],{"type":612,"value":771},{"type":606,"tag":636,"props":5557,"children":5558},{"style":684},[5559],{"type":612,"value":776},{"type":606,"tag":636,"props":5561,"children":5562},{"class":638,"line":245},[5563,5567],{"type":606,"tag":636,"props":5564,"children":5565},{"style":642},[5566],{"type":612,"value":2552},{"type":606,"tag":636,"props":5568,"children":5569},{"style":648},[5570],{"type":612,"value":2665},{"type":606,"tag":636,"props":5572,"children":5573},{"class":638,"line":254},[5574],{"type":606,"tag":636,"props":5575,"children":5576},{"emptyLinePlaceholder":13},[5577],{"type":612,"value":659},{"type":606,"tag":636,"props":5579,"children":5580},{"class":638,"line":263},[5581],{"type":606,"tag":636,"props":5582,"children":5583},{"style":665},[5584],{"type":612,"value":5585},"# Sample log entries\n",{"type":606,"tag":636,"props":5587,"children":5588},{"class":638,"line":272},[5589,5594,5598],{"type":606,"tag":636,"props":5590,"children":5591},{"style":648},[5592],{"type":612,"value":5593},"log_entries ",{"type":606,"tag":636,"props":5595,"children":5596},{"style":642},[5597],{"type":612,"value":681},{"type":606,"tag":636,"props":5599,"children":5600},{"style":648},[5601],{"type":612,"value":2697},{"type":606,"tag":636,"props":5603,"children":5604},{"class":638,"line":281},[5605,5610],{"type":606,"tag":636,"props":5606,"children":5607},{"style":684},[5608],{"type":612,"value":5609},"    \"2024-01-15 10:30:45 [INFO] User 192.168.1.100 logged in\"",{"type":606,"tag":636,"props":5611,"children":5612},{"style":648},[5613],{"type":612,"value":2710},{"type":606,"tag":636,"props":5615,"children":5616},{"class":638,"line":291},[5617,5622],{"type":606,"tag":636,"props":5618,"children":5619},{"style":684},[5620],{"type":612,"value":5621},"    \"2024-01-15 10:31:12 [ERROR] 404 error for /missing-page\"",{"type":606,"tag":636,"props":5623,"children":5624},{"style":648},[5625],{"type":612,"value":2710},{"type":606,"tag":636,"props":5627,"children":5628},{"class":638,"line":302},[5629],{"type":606,"tag":636,"props":5630,"children":5631},{"style":684},[5632],{"type":612,"value":5633},"    \"2024-01-15 10:31:45 [WARN] High CPU usage detected\"\n",{"type":606,"tag":636,"props":5635,"children":5636},{"class":638,"line":311},[5637],{"type":606,"tag":636,"props":5638,"children":5639},{"style":648},[5640],{"type":612,"value":2750},{"type":606,"tag":636,"props":5642,"children":5643},{"class":638,"line":320},[5644],{"type":606,"tag":636,"props":5645,"children":5646},{"emptyLinePlaceholder":13},[5647],{"type":612,"value":659},{"type":606,"tag":636,"props":5649,"children":5650},{"class":638,"line":329},[5651,5655,5659,5664],{"type":606,"tag":636,"props":5652,"children":5653},{"style":727},[5654],{"type":612,"value":908},{"type":606,"tag":636,"props":5656,"children":5657},{"style":648},[5658],{"type":612,"value":913},{"type":606,"tag":636,"props":5660,"children":5661},{"style":684},[5662],{"type":612,"value":5663},"\"Parsed log entries:\"",{"type":606,"tag":636,"props":5665,"children":5666},{"style":648},[5667],{"type":612,"value":948},{"type":606,"tag":636,"props":5669,"children":5670},{"class":638,"line":338},[5671,5675,5680,5684],{"type":606,"tag":636,"props":5672,"children":5673},{"style":642},[5674],{"type":612,"value":2765},{"type":606,"tag":636,"props":5676,"children":5677},{"style":648},[5678],{"type":612,"value":5679}," entry ",{"type":606,"tag":636,"props":5681,"children":5682},{"style":642},[5683],{"type":612,"value":2775},{"type":606,"tag":636,"props":5685,"children":5686},{"style":648},[5687],{"type":612,"value":5688}," log_entries:\n",{"type":606,"tag":636,"props":5690,"children":5691},{"class":638,"line":347},[5692,5696,5700],{"type":606,"tag":636,"props":5693,"children":5694},{"style":648},[5695],{"type":612,"value":4815},{"type":606,"tag":636,"props":5697,"children":5698},{"style":642},[5699],{"type":612,"value":681},{"type":606,"tag":636,"props":5701,"children":5702},{"style":648},[5703],{"type":612,"value":5704}," parse_log_entry(entry)\n",{"type":606,"tag":636,"props":5706,"children":5707},{"class":638,"line":356},[5708,5712],{"type":606,"tag":636,"props":5709,"children":5710},{"style":642},[5711],{"type":612,"value":3093},{"type":606,"tag":636,"props":5713,"children":5714},{"style":648},[5715],{"type":612,"value":5716}," parsed:\n",{"type":606,"tag":636,"props":5718,"children":5719},{"class":638,"line":367},[5720,5725,5729,5733,5738,5742,5747,5752,5756,5760,5764,5768,5772,5777,5781,5785,5789],{"type":606,"tag":636,"props":5721,"children":5722},{"style":727},[5723],{"type":612,"value":5724},"        print",{"type":606,"tag":636,"props":5726,"children":5727},{"style":648},[5728],{"type":612,"value":913},{"type":606,"tag":636,"props":5730,"children":5731},{"style":642},[5732],{"type":612,"value":918},{"type":606,"tag":636,"props":5734,"children":5735},{"style":684},[5736],{"type":612,"value":5737},"\"  ",{"type":606,"tag":636,"props":5739,"children":5740},{"style":727},[5741],{"type":612,"value":928},{"type":606,"tag":636,"props":5743,"children":5744},{"style":648},[5745],{"type":612,"value":5746},"parsed[",{"type":606,"tag":636,"props":5748,"children":5749},{"style":684},[5750],{"type":612,"value":5751},"'level'",{"type":606,"tag":636,"props":5753,"children":5754},{"style":648},[5755],{"type":612,"value":3155},{"type":606,"tag":636,"props":5757,"children":5758},{"style":727},[5759],{"type":612,"value":938},{"type":606,"tag":636,"props":5761,"children":5762},{"style":684},[5763],{"type":612,"value":2834},{"type":606,"tag":636,"props":5765,"children":5766},{"style":727},[5767],{"type":612,"value":928},{"type":606,"tag":636,"props":5769,"children":5770},{"style":648},[5771],{"type":612,"value":5746},{"type":606,"tag":636,"props":5773,"children":5774},{"style":684},[5775],{"type":612,"value":5776},"'message'",{"type":606,"tag":636,"props":5778,"children":5779},{"style":648},[5780],{"type":612,"value":3155},{"type":606,"tag":636,"props":5782,"children":5783},{"style":727},[5784],{"type":612,"value":938},{"type":606,"tag":636,"props":5786,"children":5787},{"style":684},[5788],{"type":612,"value":943},{"type":606,"tag":636,"props":5790,"children":5791},{"style":648},[5792],{"type":612,"value":948},{"type":606,"tag":636,"props":5794,"children":5795},{"class":638,"line":376},[5796],{"type":606,"tag":636,"props":5797,"children":5798},{"emptyLinePlaceholder":13},[5799],{"type":612,"value":659},{"type":606,"tag":636,"props":5801,"children":5802},{"class":638,"line":385},[5803],{"type":606,"tag":636,"props":5804,"children":5805},{"style":665},[5806],{"type":612,"value":5807},"# Extract data from logs\n",{"type":606,"tag":636,"props":5809,"children":5810},{"class":638,"line":394},[5811,5816,5820,5825],{"type":606,"tag":636,"props":5812,"children":5813},{"style":648},[5814],{"type":612,"value":5815},"all_logs ",{"type":606,"tag":636,"props":5817,"children":5818},{"style":642},[5819],{"type":612,"value":681},{"type":606,"tag":636,"props":5821,"children":5822},{"style":684},[5823],{"type":612,"value":5824}," \" \"",{"type":606,"tag":636,"props":5826,"children":5827},{"style":648},[5828],{"type":612,"value":5829},".join(log_entries)\n",{"type":606,"tag":636,"props":5831,"children":5832},{"class":638,"line":403},[5833,5838,5842],{"type":606,"tag":636,"props":5834,"children":5835},{"style":648},[5836],{"type":612,"value":5837},"ip_addresses ",{"type":606,"tag":636,"props":5839,"children":5840},{"style":642},[5841],{"type":612,"value":681},{"type":606,"tag":636,"props":5843,"children":5844},{"style":648},[5845],{"type":612,"value":5846}," extract_ip_addresses(all_logs)\n",{"type":606,"tag":636,"props":5848,"children":5849},{"class":638,"line":412},[5850,5855,5859],{"type":606,"tag":636,"props":5851,"children":5852},{"style":648},[5853],{"type":612,"value":5854},"error_codes ",{"type":606,"tag":636,"props":5856,"children":5857},{"style":642},[5858],{"type":612,"value":681},{"type":606,"tag":636,"props":5860,"children":5861},{"style":648},[5862],{"type":612,"value":5863}," find_error_codes(all_logs)\n",{"type":606,"tag":636,"props":5865,"children":5866},{"class":638,"line":423},[5867],{"type":606,"tag":636,"props":5868,"children":5869},{"emptyLinePlaceholder":13},[5870],{"type":612,"value":659},{"type":606,"tag":636,"props":5872,"children":5873},{"class":638,"line":432},[5874,5878,5882,5886,5890,5895,5900,5904,5909,5913,5917],{"type":606,"tag":636,"props":5875,"children":5876},{"style":727},[5877],{"type":612,"value":908},{"type":606,"tag":636,"props":5879,"children":5880},{"style":648},[5881],{"type":612,"value":913},{"type":606,"tag":636,"props":5883,"children":5884},{"style":642},[5885],{"type":612,"value":918},{"type":606,"tag":636,"props":5887,"children":5888},{"style":684},[5889],{"type":612,"value":943},{"type":606,"tag":636,"props":5891,"children":5892},{"style":727},[5893],{"type":612,"value":5894},"\\n",{"type":606,"tag":636,"props":5896,"children":5897},{"style":684},[5898],{"type":612,"value":5899},"IP addresses found: ",{"type":606,"tag":636,"props":5901,"children":5902},{"style":727},[5903],{"type":612,"value":928},{"type":606,"tag":636,"props":5905,"children":5906},{"style":648},[5907],{"type":612,"value":5908},"ip_addresses",{"type":606,"tag":636,"props":5910,"children":5911},{"style":727},[5912],{"type":612,"value":938},{"type":606,"tag":636,"props":5914,"children":5915},{"style":684},[5916],{"type":612,"value":943},{"type":606,"tag":636,"props":5918,"children":5919},{"style":648},[5920],{"type":612,"value":948},{"type":606,"tag":636,"props":5922,"children":5923},{"class":638,"line":441},[5924,5928,5932,5936,5941,5945,5950,5954,5958],{"type":606,"tag":636,"props":5925,"children":5926},{"style":727},[5927],{"type":612,"value":908},{"type":606,"tag":636,"props":5929,"children":5930},{"style":648},[5931],{"type":612,"value":913},{"type":606,"tag":636,"props":5933,"children":5934},{"style":642},[5935],{"type":612,"value":918},{"type":606,"tag":636,"props":5937,"children":5938},{"style":684},[5939],{"type":612,"value":5940},"\"Error codes found: ",{"type":606,"tag":636,"props":5942,"children":5943},{"style":727},[5944],{"type":612,"value":928},{"type":606,"tag":636,"props":5946,"children":5947},{"style":648},[5948],{"type":612,"value":5949},"error_codes",{"type":606,"tag":636,"props":5951,"children":5952},{"style":727},[5953],{"type":612,"value":938},{"type":606,"tag":636,"props":5955,"children":5956},{"style":684},[5957],{"type":612,"value":943},{"type":606,"tag":636,"props":5959,"children":5960},{"style":648},[5961],{"type":612,"value":948},{"type":606,"tag":1083,"props":5963,"children":5965},{"id":5964},"regex-flags-reference",[5966],{"type":612,"value":5967},"📊 Regex Flags Reference",{"type":606,"tag":2141,"props":5969,"children":5970},{},[5971,5991],{"type":606,"tag":2145,"props":5972,"children":5973},{},[5974],{"type":606,"tag":2149,"props":5975,"children":5976},{},[5977,5982,5987],{"type":606,"tag":2153,"props":5978,"children":5979},{},[5980],{"type":612,"value":5981},"Flag",{"type":606,"tag":2153,"props":5983,"children":5984},{},[5985],{"type":612,"value":5986},"Purpose",{"type":606,"tag":2153,"props":5988,"children":5989},{},[5990],{"type":612,"value":2167},{"type":606,"tag":2169,"props":5992,"children":5993},{},[5994,6020,6058],{"type":606,"tag":2149,"props":5995,"children":5996},{},[5997,6006,6011],{"type":606,"tag":2176,"props":5998,"children":5999},{},[6000],{"type":606,"tag":632,"props":6001,"children":6003},{"className":6002},[],[6004],{"type":612,"value":6005},"re.IGNORECASE",{"type":606,"tag":2176,"props":6007,"children":6008},{},[6009],{"type":612,"value":6010},"Case-insensitive",{"type":606,"tag":2176,"props":6012,"children":6013},{},[6014],{"type":606,"tag":632,"props":6015,"children":6017},{"className":6016},[],[6018],{"type":612,"value":6019},"re.findall(r'hello', text, re.IGNORECASE)",{"type":606,"tag":2149,"props":6021,"children":6022},{},[6023,6032,6049],{"type":606,"tag":2176,"props":6024,"children":6025},{},[6026],{"type":606,"tag":632,"props":6027,"children":6029},{"className":6028},[],[6030],{"type":612,"value":6031},"re.MULTILINE",{"type":606,"tag":2176,"props":6033,"children":6034},{},[6035,6040,6042,6047],{"type":606,"tag":632,"props":6036,"children":6038},{"className":6037},[],[6039],{"type":612,"value":4113},{"type":612,"value":6041}," and ",{"type":606,"tag":632,"props":6043,"children":6045},{"className":6044},[],[6046],{"type":612,"value":2540},{"type":612,"value":6048}," match line starts/ends",{"type":606,"tag":2176,"props":6050,"children":6051},{},[6052],{"type":606,"tag":632,"props":6053,"children":6055},{"className":6054},[],[6056],{"type":612,"value":6057},"re.findall(r'^ERROR', text, re.MULTILINE)",{"type":606,"tag":2149,"props":6059,"children":6060},{},[6061,6070,6080],{"type":606,"tag":2176,"props":6062,"children":6063},{},[6064],{"type":606,"tag":632,"props":6065,"children":6067},{"className":6066},[],[6068],{"type":612,"value":6069},"re.DOTALL",{"type":606,"tag":2176,"props":6071,"children":6072},{},[6073,6078],{"type":606,"tag":632,"props":6074,"children":6076},{"className":6075},[],[6077],{"type":612,"value":2184},{"type":612,"value":6079}," matches newlines too",{"type":606,"tag":2176,"props":6081,"children":6082},{},[6083],{"type":606,"tag":632,"props":6084,"children":6086},{"className":6085},[],[6087],{"type":612,"value":6088},"re.findall(r'start.*end', text, re.DOTALL)",{"type":606,"tag":1230,"props":6090,"children":6092},{"id":6091},"using-regex-flags",[6093],{"type":612,"value":6094},"Using Regex Flags",{"type":606,"tag":621,"props":6096,"children":6097},{},[6098],{"type":606,"tag":625,"props":6099,"children":6101},{"className":627,"code":6100,"language":629,"meta":8,"style":8},"import re\n\ntext = \"\"\"INFO: Application started\nERROR: Database connection failed\nWARNING: Low memory\nERROR: User authentication failed\"\"\"\n\n# Case-insensitive search\nerrors_any_case = re.findall(r'error', text, re.IGNORECASE)\nprint(f\"Errors (any case): {errors_any_case}\")\n\n# Find lines starting with ERROR\nerror_lines = re.findall(r'^ERROR:.*', text, re.MULTILINE)\nprint(f\"Error lines: {error_lines}\")\n\n# Count different log levels\nlevels = re.findall(r'^(\\w+):', text, re.MULTILINE)\nlevel_counts = {}\nfor level in levels:\n    level_counts[level] = level_counts.get(level, 0) + 1\n\nprint(f\"Log level counts: {level_counts}\")\n",[6102],{"type":606,"tag":632,"props":6103,"children":6104},{"__ignoreMap":8},[6105,6116,6123,6139,6147,6155,6163,6170,6178,6225,6266,6273,6281,6339,6380,6387,6395,6452,6469,6490,6524,6531],{"type":606,"tag":636,"props":6106,"children":6107},{"class":638,"line":12},[6108,6112],{"type":606,"tag":636,"props":6109,"children":6110},{"style":642},[6111],{"type":612,"value":645},{"type":606,"tag":636,"props":6113,"children":6114},{"style":648},[6115],{"type":612,"value":651},{"type":606,"tag":636,"props":6117,"children":6118},{"class":638,"line":27},[6119],{"type":606,"tag":636,"props":6120,"children":6121},{"emptyLinePlaceholder":13},[6122],{"type":612,"value":659},{"type":606,"tag":636,"props":6124,"children":6125},{"class":638,"line":36},[6126,6130,6134],{"type":606,"tag":636,"props":6127,"children":6128},{"style":648},[6129],{"type":612,"value":676},{"type":606,"tag":636,"props":6131,"children":6132},{"style":642},[6133],{"type":612,"value":681},{"type":606,"tag":636,"props":6135,"children":6136},{"style":684},[6137],{"type":612,"value":6138}," \"\"\"INFO: Application started\n",{"type":606,"tag":636,"props":6140,"children":6141},{"class":638,"line":45},[6142],{"type":606,"tag":636,"props":6143,"children":6144},{"style":684},[6145],{"type":612,"value":6146},"ERROR: Database connection failed\n",{"type":606,"tag":636,"props":6148,"children":6149},{"class":638,"line":54},[6150],{"type":606,"tag":636,"props":6151,"children":6152},{"style":684},[6153],{"type":612,"value":6154},"WARNING: Low memory\n",{"type":606,"tag":636,"props":6156,"children":6157},{"class":638,"line":63},[6158],{"type":606,"tag":636,"props":6159,"children":6160},{"style":684},[6161],{"type":612,"value":6162},"ERROR: User authentication failed\"\"\"\n",{"type":606,"tag":636,"props":6164,"children":6165},{"class":638,"line":72},[6166],{"type":606,"tag":636,"props":6167,"children":6168},{"emptyLinePlaceholder":13},[6169],{"type":612,"value":659},{"type":606,"tag":636,"props":6171,"children":6172},{"class":638,"line":81},[6173],{"type":606,"tag":636,"props":6174,"children":6175},{"style":665},[6176],{"type":612,"value":6177},"# Case-insensitive search\n",{"type":606,"tag":636,"props":6179,"children":6180},{"class":638,"line":796},[6181,6186,6190,6194,6198,6202,6207,6211,6216,6221],{"type":606,"tag":636,"props":6182,"children":6183},{"style":648},[6184],{"type":612,"value":6185},"errors_any_case ",{"type":606,"tag":636,"props":6187,"children":6188},{"style":642},[6189],{"type":612,"value":681},{"type":606,"tag":636,"props":6191,"children":6192},{"style":648},[6193],{"type":612,"value":1311},{"type":606,"tag":636,"props":6195,"children":6196},{"style":642},[6197],{"type":612,"value":1316},{"type":606,"tag":636,"props":6199,"children":6200},{"style":684},[6201],{"type":612,"value":724},{"type":606,"tag":636,"props":6203,"children":6204},{"style":738},[6205],{"type":612,"value":6206},"error",{"type":606,"tag":636,"props":6208,"children":6209},{"style":684},[6210],{"type":612,"value":724},{"type":606,"tag":636,"props":6212,"children":6213},{"style":648},[6214],{"type":612,"value":6215},", text, re.",{"type":606,"tag":636,"props":6217,"children":6218},{"style":727},[6219],{"type":612,"value":6220},"IGNORECASE",{"type":606,"tag":636,"props":6222,"children":6223},{"style":648},[6224],{"type":612,"value":948},{"type":606,"tag":636,"props":6226,"children":6227},{"class":638,"line":99},[6228,6232,6236,6240,6245,6249,6254,6258,6262],{"type":606,"tag":636,"props":6229,"children":6230},{"style":727},[6231],{"type":612,"value":908},{"type":606,"tag":636,"props":6233,"children":6234},{"style":648},[6235],{"type":612,"value":913},{"type":606,"tag":636,"props":6237,"children":6238},{"style":642},[6239],{"type":612,"value":918},{"type":606,"tag":636,"props":6241,"children":6242},{"style":684},[6243],{"type":612,"value":6244},"\"Errors (any case): ",{"type":606,"tag":636,"props":6246,"children":6247},{"style":727},[6248],{"type":612,"value":928},{"type":606,"tag":636,"props":6250,"children":6251},{"style":648},[6252],{"type":612,"value":6253},"errors_any_case",{"type":606,"tag":636,"props":6255,"children":6256},{"style":727},[6257],{"type":612,"value":938},{"type":606,"tag":636,"props":6259,"children":6260},{"style":684},[6261],{"type":612,"value":943},{"type":606,"tag":636,"props":6263,"children":6264},{"style":648},[6265],{"type":612,"value":948},{"type":606,"tag":636,"props":6267,"children":6268},{"class":638,"line":108},[6269],{"type":606,"tag":636,"props":6270,"children":6271},{"emptyLinePlaceholder":13},[6272],{"type":612,"value":659},{"type":606,"tag":636,"props":6274,"children":6275},{"class":638,"line":117},[6276],{"type":606,"tag":636,"props":6277,"children":6278},{"style":665},[6279],{"type":612,"value":6280},"# Find lines starting with ERROR\n",{"type":606,"tag":636,"props":6282,"children":6283},{"class":638,"line":126},[6284,6289,6293,6297,6301,6305,6309,6314,6318,6322,6326,6330,6335],{"type":606,"tag":636,"props":6285,"children":6286},{"style":648},[6287],{"type":612,"value":6288},"error_lines ",{"type":606,"tag":636,"props":6290,"children":6291},{"style":642},[6292],{"type":612,"value":681},{"type":606,"tag":636,"props":6294,"children":6295},{"style":648},[6296],{"type":612,"value":1311},{"type":606,"tag":636,"props":6298,"children":6299},{"style":642},[6300],{"type":612,"value":1316},{"type":606,"tag":636,"props":6302,"children":6303},{"style":684},[6304],{"type":612,"value":724},{"type":606,"tag":636,"props":6306,"children":6307},{"style":727},[6308],{"type":612,"value":4113},{"type":606,"tag":636,"props":6310,"children":6311},{"style":738},[6312],{"type":612,"value":6313},"ERROR:",{"type":606,"tag":636,"props":6315,"children":6316},{"style":727},[6317],{"type":612,"value":2184},{"type":606,"tag":636,"props":6319,"children":6320},{"style":642},[6321],{"type":612,"value":2294},{"type":606,"tag":636,"props":6323,"children":6324},{"style":684},[6325],{"type":612,"value":724},{"type":606,"tag":636,"props":6327,"children":6328},{"style":648},[6329],{"type":612,"value":6215},{"type":606,"tag":636,"props":6331,"children":6332},{"style":727},[6333],{"type":612,"value":6334},"MULTILINE",{"type":606,"tag":636,"props":6336,"children":6337},{"style":648},[6338],{"type":612,"value":948},{"type":606,"tag":636,"props":6340,"children":6341},{"class":638,"line":135},[6342,6346,6350,6354,6359,6363,6368,6372,6376],{"type":606,"tag":636,"props":6343,"children":6344},{"style":727},[6345],{"type":612,"value":908},{"type":606,"tag":636,"props":6347,"children":6348},{"style":648},[6349],{"type":612,"value":913},{"type":606,"tag":636,"props":6351,"children":6352},{"style":642},[6353],{"type":612,"value":918},{"type":606,"tag":636,"props":6355,"children":6356},{"style":684},[6357],{"type":612,"value":6358},"\"Error lines: ",{"type":606,"tag":636,"props":6360,"children":6361},{"style":727},[6362],{"type":612,"value":928},{"type":606,"tag":636,"props":6364,"children":6365},{"style":648},[6366],{"type":612,"value":6367},"error_lines",{"type":606,"tag":636,"props":6369,"children":6370},{"style":727},[6371],{"type":612,"value":938},{"type":606,"tag":636,"props":6373,"children":6374},{"style":684},[6375],{"type":612,"value":943},{"type":606,"tag":636,"props":6377,"children":6378},{"style":648},[6379],{"type":612,"value":948},{"type":606,"tag":636,"props":6381,"children":6382},{"class":638,"line":144},[6383],{"type":606,"tag":636,"props":6384,"children":6385},{"emptyLinePlaceholder":13},[6386],{"type":612,"value":659},{"type":606,"tag":636,"props":6388,"children":6389},{"class":638,"line":153},[6390],{"type":606,"tag":636,"props":6391,"children":6392},{"style":665},[6393],{"type":612,"value":6394},"# Count different log levels\n",{"type":606,"tag":636,"props":6396,"children":6397},{"class":638,"line":163},[6398,6403,6407,6411,6415,6419,6424,6428,6432,6436,6440,6444,6448],{"type":606,"tag":636,"props":6399,"children":6400},{"style":648},[6401],{"type":612,"value":6402},"levels ",{"type":606,"tag":636,"props":6404,"children":6405},{"style":642},[6406],{"type":612,"value":681},{"type":606,"tag":636,"props":6408,"children":6409},{"style":648},[6410],{"type":612,"value":1311},{"type":606,"tag":636,"props":6412,"children":6413},{"style":642},[6414],{"type":612,"value":1316},{"type":606,"tag":636,"props":6416,"children":6417},{"style":684},[6418],{"type":612,"value":724},{"type":606,"tag":636,"props":6420,"children":6421},{"style":727},[6422],{"type":612,"value":6423},"^(\\w",{"type":606,"tag":636,"props":6425,"children":6426},{"style":642},[6427],{"type":612,"value":735},{"type":606,"tag":636,"props":6429,"children":6430},{"style":727},[6431],{"type":612,"value":1915},{"type":606,"tag":636,"props":6433,"children":6434},{"style":738},[6435],{"type":612,"value":3182},{"type":606,"tag":636,"props":6437,"children":6438},{"style":684},[6439],{"type":612,"value":724},{"type":606,"tag":636,"props":6441,"children":6442},{"style":648},[6443],{"type":612,"value":6215},{"type":606,"tag":636,"props":6445,"children":6446},{"style":727},[6447],{"type":612,"value":6334},{"type":606,"tag":636,"props":6449,"children":6450},{"style":648},[6451],{"type":612,"value":948},{"type":606,"tag":636,"props":6453,"children":6454},{"class":638,"line":172},[6455,6460,6464],{"type":606,"tag":636,"props":6456,"children":6457},{"style":648},[6458],{"type":612,"value":6459},"level_counts ",{"type":606,"tag":636,"props":6461,"children":6462},{"style":642},[6463],{"type":612,"value":681},{"type":606,"tag":636,"props":6465,"children":6466},{"style":648},[6467],{"type":612,"value":6468}," {}\n",{"type":606,"tag":636,"props":6470,"children":6471},{"class":638,"line":181},[6472,6476,6481,6485],{"type":606,"tag":636,"props":6473,"children":6474},{"style":642},[6475],{"type":612,"value":2765},{"type":606,"tag":636,"props":6477,"children":6478},{"style":648},[6479],{"type":612,"value":6480}," level ",{"type":606,"tag":636,"props":6482,"children":6483},{"style":642},[6484],{"type":612,"value":2775},{"type":606,"tag":636,"props":6486,"children":6487},{"style":648},[6488],{"type":612,"value":6489}," levels:\n",{"type":606,"tag":636,"props":6491,"children":6492},{"class":638,"line":190},[6493,6498,6502,6507,6511,6515,6519],{"type":606,"tag":636,"props":6494,"children":6495},{"style":648},[6496],{"type":612,"value":6497},"    level_counts[level] ",{"type":606,"tag":636,"props":6499,"children":6500},{"style":642},[6501],{"type":612,"value":681},{"type":606,"tag":636,"props":6503,"children":6504},{"style":648},[6505],{"type":612,"value":6506}," level_counts.get(level, ",{"type":606,"tag":636,"props":6508,"children":6509},{"style":727},[6510],{"type":612,"value":3265},{"type":606,"tag":636,"props":6512,"children":6513},{"style":648},[6514],{"type":612,"value":3164},{"type":606,"tag":636,"props":6516,"children":6517},{"style":642},[6518],{"type":612,"value":735},{"type":606,"tag":636,"props":6520,"children":6521},{"style":727},[6522],{"type":612,"value":6523}," 1\n",{"type":606,"tag":636,"props":6525,"children":6526},{"class":638,"line":199},[6527],{"type":606,"tag":636,"props":6528,"children":6529},{"emptyLinePlaceholder":13},[6530],{"type":612,"value":659},{"type":606,"tag":636,"props":6532,"children":6533},{"class":638,"line":208},[6534,6538,6542,6546,6551,6555,6560,6564,6568],{"type":606,"tag":636,"props":6535,"children":6536},{"style":727},[6537],{"type":612,"value":908},{"type":606,"tag":636,"props":6539,"children":6540},{"style":648},[6541],{"type":612,"value":913},{"type":606,"tag":636,"props":6543,"children":6544},{"style":642},[6545],{"type":612,"value":918},{"type":606,"tag":636,"props":6547,"children":6548},{"style":684},[6549],{"type":612,"value":6550},"\"Log level counts: ",{"type":606,"tag":636,"props":6552,"children":6553},{"style":727},[6554],{"type":612,"value":928},{"type":606,"tag":636,"props":6556,"children":6557},{"style":648},[6558],{"type":612,"value":6559},"level_counts",{"type":606,"tag":636,"props":6561,"children":6562},{"style":727},[6563],{"type":612,"value":938},{"type":606,"tag":636,"props":6565,"children":6566},{"style":684},[6567],{"type":612,"value":943},{"type":606,"tag":636,"props":6569,"children":6570},{"style":648},[6571],{"type":612,"value":948},{"type":606,"tag":1083,"props":6573,"children":6575},{"id":6574},"key-takeaways",[6576],{"type":612,"value":6577},"🎯 Key Takeaways",{"type":606,"tag":1095,"props":6579,"children":6583},{"emoji":6580,"title":6581,"type":6582},"📚","Regex Essentials","success",[6584,6592,6632,6640,6718,6726,6749],{"type":606,"tag":615,"props":6585,"children":6586},{},[6587],{"type":606,"tag":1105,"props":6588,"children":6589},{},[6590],{"type":612,"value":6591},"Basic Functions:",{"type":606,"tag":1111,"props":6593,"children":6594},{},[6595,6604,6613,6623],{"type":606,"tag":1115,"props":6596,"children":6597},{},[6598,6603],{"type":606,"tag":632,"props":6599,"children":6601},{"className":6600},[],[6602],{"type":612,"value":1204},{"type":612,"value":1206},{"type":606,"tag":1115,"props":6605,"children":6606},{},[6607,6612],{"type":606,"tag":632,"props":6608,"children":6610},{"className":6609},[],[6611],{"type":612,"value":1193},{"type":612,"value":1195},{"type":606,"tag":1115,"props":6614,"children":6615},{},[6616,6621],{"type":606,"tag":632,"props":6617,"children":6619},{"className":6618},[],[6620],{"type":612,"value":1215},{"type":612,"value":6622}," - Match from beginning",{"type":606,"tag":1115,"props":6624,"children":6625},{},[6626,6631],{"type":606,"tag":632,"props":6627,"children":6629},{"className":6628},[],[6630],{"type":612,"value":1226},{"type":612,"value":1228},{"type":606,"tag":615,"props":6633,"children":6634},{},[6635],{"type":606,"tag":1105,"props":6636,"children":6637},{},[6638],{"type":612,"value":6639},"Common Patterns:",{"type":606,"tag":1111,"props":6641,"children":6642},{},[6643,6667,6684,6701],{"type":606,"tag":1115,"props":6644,"children":6645},{},[6646,6651,6653,6658,6660,6665],{"type":606,"tag":632,"props":6647,"children":6649},{"className":6648},[],[6650],{"type":612,"value":839},{"type":612,"value":6652}," for digits, ",{"type":606,"tag":632,"props":6654,"children":6656},{"className":6655},[],[6657],{"type":612,"value":2239},{"type":612,"value":6659}," for word characters, ",{"type":606,"tag":632,"props":6661,"children":6663},{"className":6662},[],[6664],{"type":612,"value":2070},{"type":612,"value":6666}," for whitespace",{"type":606,"tag":1115,"props":6668,"children":6669},{},[6670,6675,6677,6682],{"type":606,"tag":632,"props":6671,"children":6673},{"className":6672},[],[6674],{"type":612,"value":735},{"type":612,"value":6676}," for one or more, ",{"type":606,"tag":632,"props":6678,"children":6680},{"className":6679},[],[6681],{"type":612,"value":2294},{"type":612,"value":6683}," for zero or more",{"type":606,"tag":1115,"props":6685,"children":6686},{},[6687,6692,6694,6699],{"type":606,"tag":632,"props":6688,"children":6690},{"className":6689},[],[6691],{"type":612,"value":2377},{"type":612,"value":6693}," for character sets, ",{"type":606,"tag":632,"props":6695,"children":6697},{"className":6696},[],[6698],{"type":612,"value":2405},{"type":612,"value":6700}," for groups",{"type":606,"tag":1115,"props":6702,"children":6703},{},[6704,6709,6711,6716],{"type":606,"tag":632,"props":6705,"children":6707},{"className":6706},[],[6708],{"type":612,"value":4113},{"type":612,"value":6710}," for start, ",{"type":606,"tag":632,"props":6712,"children":6714},{"className":6713},[],[6715],{"type":612,"value":2540},{"type":612,"value":6717}," for end",{"type":606,"tag":615,"props":6719,"children":6720},{},[6721],{"type":606,"tag":1105,"props":6722,"children":6723},{},[6724],{"type":612,"value":6725},"Best Practices:",{"type":606,"tag":1111,"props":6727,"children":6728},{},[6729,6734,6739,6744],{"type":606,"tag":1115,"props":6730,"children":6731},{},[6732],{"type":612,"value":6733},"Start with simple patterns and build complexity",{"type":606,"tag":1115,"props":6735,"children":6736},{},[6737],{"type":612,"value":6738},"Use raw strings (r'pattern') to avoid escape issues",{"type":606,"tag":1115,"props":6740,"children":6741},{},[6742],{"type":612,"value":6743},"Test patterns with sample data",{"type":606,"tag":1115,"props":6745,"children":6746},{},[6747],{"type":612,"value":6748},"Consider using flags for case sensitivity and multiline",{"type":606,"tag":615,"props":6750,"children":6751},{},[6752,6757],{"type":606,"tag":1105,"props":6753,"children":6754},{},[6755],{"type":612,"value":6756},"Remember:",{"type":612,"value":6758}," Regex is powerful but can be complex - start simple and practice!",{"type":606,"tag":1083,"props":6760,"children":6762},{"id":6761},"whats-next",[6763],{"type":612,"value":6764},"🚀 What's Next?",{"type":606,"tag":615,"props":6766,"children":6767},{},[6768],{"type":612,"value":6769},"Learn how to parse structured markup languages like XML and HTML to extract data from web content.",{"type":606,"tag":615,"props":6771,"children":6772},{},[6773,6778,6779],{"type":606,"tag":1105,"props":6774,"children":6775},{},[6776],{"type":612,"value":6777},"Continue to",{"type":612,"value":2834},{"type":606,"tag":6780,"props":6781,"children":6782},"a",{"href":493},[6783],{"type":612,"value":494},{"type":606,"tag":6785,"props":6786,"children":6787},"style",{},[6788],{"type":612,"value":6789},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":6791},[6792,6796,6797,6803,6806,6807],{"id":1085,"depth":27,"text":1088,"children":6793},[6794,6795],{"id":1232,"depth":36,"text":1235},{"id":1651,"depth":36,"text":1654},{"id":2136,"depth":27,"text":2139},{"id":2424,"depth":27,"text":2427,"children":6798},[6799,6800,6801,6802],{"id":2430,"depth":36,"text":2433},{"id":2966,"depth":36,"text":2969},{"id":4015,"depth":36,"text":4018},{"id":5068,"depth":36,"text":5071},{"id":5964,"depth":27,"text":5967,"children":6804},[6805],{"id":6091,"depth":36,"text":6094},{"id":6574,"depth":27,"text":6577},{"id":6761,"depth":27,"text":6764},1782373762882]