Blog

Page 571 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for How can I find all matches to a regular expression in Python?
pythonregex

How can I find all matches to a regular expression in Python?

Published on September 2, 2023

šŸ” How to Find All Matches to a Regular Expression in Python šŸ” Are you tired of Python leaving you high and dry after finding just one match using the `re.search()` function? Do you need a way to find ALL the matches in a block of text and keep going unt

Cover Image for Regular expression search replace in Sublime Text 2
regexreplace

Regular expression search replace in Sublime Text 2

Published on September 2, 2023

# Regular Expression Search Replace in Sublime Text 2 šŸ–ŠļøšŸ’» Are you struggling with regular expression search and replace in Sublime Text 2? You're not alone! Many users find the documentation on this feature to be rather "anemic." But fear not! šŸ™…ā€ā™‚ļø In

Cover Image for How to extract numbers from a string in Python?
numberspythonstring

How to extract numbers from a string in Python?

Published on September 2, 2023

# How to extract numbers from a string in Python? šŸ“ŠšŸ”¢šŸ’» Have you ever encountered a situation where you needed to extract all the numbers contained within a string in Python? šŸ¤” Whether you're dealing with user input, parsing text files, or just trying t

Cover Image for How to input a regex in string.replace?
pythonregexreplacestring

How to input a regex in string.replace?

Published on September 2, 2023

# How to Input a Regex in string.replace? Hey there tech enthusiasts! šŸ‘‹ Are you struggling with declaring a regex while using `string.replace`? Don't worry, you're not alone! šŸ˜… In this blog post, we'll address this common issue and provide you with easy

Cover Image for Non greedy (reluctant) regex matching in sed?
regex

Non greedy (reluctant) regex matching in sed?

Published on September 2, 2023

šŸ“ **Title: Non-greedy (Reluctant) Regex Matching in sed: How to Extract Domains from URLs** 🌐 šŸ‘‹ Hey there tech enthusiasts! Today, we're diving into the sed command and how to use it to extract domain names from URLs. If you've ever struggled with non-

Cover Image for How do I type hint a method with the type of the enclosing class?
pythonpython-3.x

How do I type hint a method with the type of the enclosing class?

Published on September 2, 2023

# How to Type Hint a Method with the Type of the Enclosing Class šŸ’” Have you ever encountered an issue where your editor tells you that a reference in your code cannot be resolved? Specifically, have you faced this problem when trying to type hint a metho

Cover Image for How can I write a regex which matches non greedy?
regex

How can I write a regex which matches non greedy?

Published on September 2, 2023

## How to Write a Non-Greedy Regex? šŸ˜Žāœļø Do you need help with regular expression matching using the non-greedy option? Look no further, because we've got you covered! In this article, we'll address common issues surrounding non-greedy regular expressions

Cover Image for Check if string matches pattern
pythonregexstringstring-matching

Check if string matches pattern

Published on September 2, 2023

# How to Check If a String Matches a Pattern Are you struggling to determine if a string matches a specific pattern? šŸ¤” Don't worry - we've got you covered! In this blog post, we'll address the common issue of checking if a string matches a certain patter

Cover Image for Regex: match everything but a specific pattern
regex

Regex: match everything but a specific pattern

Published on September 2, 2023

# How to Use Regex to Match Everything Except a Specific Pattern 😮✨ Are you struggling to create a regular expression that matches everything except a specific pattern? We've got you covered! In this guide, we'll walk you through the common issues and pr

Cover Image for Regex lookahead, lookbehind and atomic groups
regex

Regex lookahead, lookbehind and atomic groups

Published on September 2, 2023

# Unlocking the Power of Regex Lookahead, Lookbehind, and Atomic Groups šŸ•µļøā€ā™€ļøšŸ”šŸ’£ Have you ever come across those mysterious symbols like `(?!)` or `(?=)` in a regular expression (regex) and wondered what they do? Well, fret no more! In this blog post, w