Open post
Patterns Logo

Expressions, Patterns & Regex101 Make Writing Regular Expressions Easy and Fun

In my post about using regular expressions to find matches in a text file, I promised to tell you about the two applications I used to help me write my regex. By the way, Regex is what the cool kids call Regular Expressions.

Let’s state the problem to be solved first. If you have a text file where you want to change something that’s repeated throughout the file, it’s pretty easy to do a search/change all. We do it all the time in text editors. But what if you have a text file that is repeatedly generated and always has the same thing wrong with it? Maybe it’s a date in the wrong format. Or maybe an online system hasn’t been updated with your new company name. Or what if instead of changing the text, you just need to know what the text actually says? Let’s say it’s a date in a document and you want to write a script to change the name of the document to include the date? All of these examples are a great place to try out regex.

Continue reading “Expressions, Patterns & Regex101 Make Writing Regular Expressions Easy and Fun”

CCATP #446 – Programming by Stealth – 18 of x JavaScript Miscellany

In this episode of Programming By Stealth, Bart Busschots takes us through the final stages of learning JavaScript within the playground. Now that we know about objects, we need to re-visit the arguments object present in every JavaScript function. We need to take a detailed look at the typeof operator, and we need to look at some built-in objects and functions JavaScript provides. We also need to look at how JavaScript handles regular expressions, and finally, we need to introduce the concept of exception handling. Bart’s full written tutorial is available at….

mp3 download

During this episode we briefly mention a wonderful email from Jill about factorials and more. I wanted to include the full letter in the shownotes here because it contains some wonderful explanations, especially an even better explanation of strongly vs. weakly-typed languages. Here’s Jill’s entire letter:

Hi, me again

I think there’s a concept you haven’t quite grasped in PBS, and that’s types. I know you’ve mostly got it, but I think perhaps I might be able to help unconfuse you on a few edge cases.
Continue reading “CCATP #446 – Programming by Stealth – 18 of x JavaScript Miscellany”

Scroll to top