Blog
Page 634 of my articles, tutorials, and thoughts
Latest Articles
How to extract a substring using regex
# Extracting a Substring with Regex: Unleashing the Power of Regex Magic āØāļø So, you have a string that contains a valuable piece of information trapped between two single quotes, and you're wondering how to use regex to extract it. Well, fear not! We're
Regex match one of two words
# **šš Regex Magic: Matching Either "Apple" or "Banana" š§āāļø** Welcome, tech enthusiasts! Today, we are going to unravel the enchanting world of regular expressions, taking on the challenge of matching either "apple" or "banana" from a given input. š§
How to replace plain URLs with links?
# How to Replace Plain URLs with Links Are you tired of plain, boring URLs cluttering up your text? Do you want to make your content look more professional and visually appealing? Well, you're in luck! In this blog post, we'll show you an easy solution to
How can I find all matches to a regular expression in Python?
š 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
Regular expression search replace in Sublime Text 2
# 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
How to extract numbers from a string in Python?
# 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
How to input a regex in string.replace?
# 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
Non greedy (reluctant) regex matching in sed?
š **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-
How do I type hint a method with the type of the enclosing class?
# 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






