Today’s the day I write my very first blog post. This is much more intimidating than I had anticipated.
I write to you, dear reader, to both show my pride in completion of my very first self-designed programming project, and to underscore the challenges and frustrations I faced in getting this thing live.
I’m talking, of course, about the Regex Converter. This no doubt soon-to-be-famous, simple web app was born out of a two-fold need. The first driving force behind it was obligation. I needed to come up with, design, write, build, and deploy some… thing to present as a final project to complete a little (not so little) online course called CS50. Or, more formally, Harvard CS50’s Introduction to Computer Science. We’ll save the second deciding factor for later.
I started CS50 because a colleague of mine took a proactive approach to finding growth and career development opportunities, instead of waiting for them to come to him. Not only did he look for these opportunities for himself, he also ventured forth to build an after-work-hours study group of like-minded work mates to work through and study together. Thanks, Ryan – I wouldn’t be writing this blog right now if not for your enthusiastic plugs of how fun and challenging it was to make silly games in Scratch.
I started the course in April of 2019 and finished on the exact deadline – December 31st of the same year. Boy, was it stressful right down at the end there. During the course of CS50, we journeyed from the light-hearted Scratch to the hair-pulling world of resizing .jpgs in C, and on toward the abstraction-rich tool that is Python. From there, we integrated Python with Flask and Jinja to create our very own, somewhat functional web apps! It is upon the skeleton of the C$50 Finance problem that I built my Regex app.
Now, let’s get back to reason number two of this thing’s birth. As part of my role at work, I analyze raw text data using a SQL-like query language that doesn’t offer a case insensitivity option. We got around this issue with Regex, and we wrote the Regex slowly, by hand. For example, let’s say we’re looking to find rows in a table that contain the word “pear,” but we don’t know the case mix to expect, and we want all case version represented. This required us to manually write .*[Pp][Ee][Aa][Rr].* – just typing that four letter word just now took me a good 25 seconds, and I made some errors. It. Was. Ridiculous. There must be a better way!
So, rather than continuing to fruitlessly request a case insensitivity option for our query language, I figured I could at least automate the Regex writing process. After all, it’s incredibly repetitive and predictable – exactly what automation is made for. Best of all, I figured I could do so with my nascent Python skills. My algorithms may not be elegant, but they get the job done right every time! In fact, I’m so unashamed of them, I’m willing to share my source code, right here, right now! (Note – I accept constructive criticism on both the contents of the repository and on this presentation thereof.)
“I don’t feel like opening all that,” I hear you say. That’s cool too – you’ll get some screencaps of both the UI and the output near the bottom of the post, here.
So anyway, I’m sure my pride shows through fine. On to the challenges, as promised. Without getting into the fact that CS50 is the most challenging online course I’ve ever come across, let alone undertaken, I’ll jump right into deployment on Heroku. CS50 is generous enough to provide a fully functional and robust IDE to both write and run code with, so right up until the end of the course, I had it easy. Then, the real world knocked me squarely on my bottom.
Now, I will impart on to you two critical facts that I learned during the course of the deployment process. The first is that, to deploy a Python app on Heroku, you need a procfile. Heroku does a better job of explaining what exactly that is here. The second critical fact is that, if you mess up your procfile the first time, it’s really hard to convince Heroku to overwrite it with new versions. Like, really hard. Or at least it was for me! I spent a good 5-6 hours troubleshooting just this one aspect, and in a way it was a blessing in disguise because I sure learned a lot about how not to procfile.
So, if you take nothing else from this post (unlikely, given the glowing wonder of the Regex app linked herein,) know this: Write your procfile in a program that doesn’t append newlines to the end of your text (like a code editor or just command line) and get it right the first time. If not, you’ll be stuck either hunting through your gitignore file, or if you’re a stubborn goat like I am, making a whole new repository just to get a clean start. In fact, if you looked at the code I linked above, you’ll notice my -m’s literally say “fresh start.” Although I’ll never get those hours of my life back, the joy I felt in finally seeing my app living free and in the wild was immense!

Behold! What style, what finesse, what elegant design! Ok, maybe that’s pushing it a little bit, but at least you can read the text and it doesn’t flow off the page. Gotta start somewhere, right?
I’m particularly pleased with my output samples. Because how would you describe the output in words? It’s quite obscure, but for all that, exactly what I needed to ease my regex and case sensitivity woes.

Assuming you’re curious about all 5 options, (and who wouldn’t be?) I’m happy to share the output below for your perusal (and formatting judgment.)

Did I mention earlier I accept constructive criticism? I’m really on the verge of demanding it with output formatted like that.
And now, on to the next challenge – deploying the very same app internally. It sounded all sunshine and daisies until I realized the maze of requirements I’ll be wading through to make this happen. It’ll be procfile-esque troubleshooting for hours on end again, I just know it.
Look at you! You made it all the way to the bottom of the post. Did you skip the middle? Did you painstakingly read every word? Either way, I’m grateful for your attention to this first rant, and I look forward to sharing more of my experiences as I fall into proverbial pits and climb back out – hopefully the stick I placed across the pitfall will help at least one of you tiptoe across without falling in too!
Thanks for looking at the very first installment of LPT! Learn. Practice. Teach.

P.S. I didn’t read over the post before posting in case I chicken’d out altogether. Feel free to mercilessly point out typos, grammatical errors, etc. I’m happy enough feeding the trolls with this one.
LikeLike