Numeric Palindrome
I posted a coding challenge in the second issue of learnbyexample weekly. I discuss the problem and Python/Perl solutions in this blog post.
I posted a coding challenge in the second issue of learnbyexample weekly. I discuss the problem and Python/Perl solutions in this blog post.
Hello!
I'm excited to announce learnbyexample weekly newsletter, scheduled to be delivered every Friday.
This free newsletter will help you discover awesome programming resources. I'll primarily focus on resources related to Python, Linux, CLI tools, Regular Expressions and Vim. Sometimes, I'll also include other programming resources.
Hello!
You never know where a conversation between indie authors will lead to. A tweet about Leanpub Python book sales brought up giveaways that we indie authors tend to do. Long story short, the four of us ended up deciding to create The Indie Python Extravaganza bundle.
And guess what?! You can use this pytober coupon link to get the bundle for FREE (the offer is valid till 31-Oct-2021).
Hello!
My "Practice Python Projects" ebook presents five beginner-to-intermediate level projects inspired by real world use cases:
To test your understanding and to make it more interesting, you'll also be presented with exercises at the end of each project. Resources for further exploration are also mentioned throughout the book.
I'm building a tool called rcut that allows you to use cut like syntax with features like regexp based delimiters. The solution uses awk inside a bash script.
Latest feature creep is fixed string field splitting. I thought it would be a simple enough solution to add.
I was wrong.

Poster created using Canva
This post covers Basic Regular Expressions (BRE) and Extended Regular Expressions (ERE) syntax supported by GNU grep, sed and awk. You'll also learn the differences between these tools — for example, awk doesn't support backreferences within regexp definition (i.e. the search portion).
TL;DR: Small victories are more precious when you have nothing. Instead of burning through my savings, I'm now adding to it. The relief is priceless.
This post shows how you can use the ripgrep, perl and sd commands to perform multiline fixed string search and replace operations from the command line. Solutions with GNU sed is also discussed, along with its limitations.
This stackoverflow Q&A got me thinking about various ways to construct a solution in GNU sed if lookarounds are needed.
Only single line (with newline as the line separator) processing is presented here. Equivalent lookaround syntax with
grep -Porperlis also shown for comparison. Cases where multiple lines and/or ASCII NUL characters are present in the pattern space is left as an exercise.
ripgrep (command name rg) is a grep tool, but supports search and replace as well. rg is far from a like-for-like alternate for sed, but it has nifty features like multiline replacement, fixed string matching, PCRE2 support, etc. This post gives an overview of syntax for substitution and highlights some of the cases where rg is a handy replacement for sed.