Tag Archives: expression

regexProgram: Add to your education

I don’t want this program to be bracketed as a “game” really, but it will probably look like one after a weekend of games. This is regexProgram, and I see this more as a practice or an exercise than a game, per se.

2015-02-09-6m47421-regexprogram

If you’re like me, and you only need or use regular expressions about two or three times a month, it’s not a skill that is particularly well developed. I know enough to search the vast wealth of the Internet to get something done, but not enough to muddle through things on my own.

regexProgram is a series of drills to think your way through, with each exercise becoming more and more complex. The first two or so were accessible to me, but beyond that, and I had to start looking for help elsewhere.

So in that sense, I can tell you that this isn’t a tool for solving regular expressions, like txt2regex was. And it’s not really a game, unless you find this sort of thing amusing and you’re willing to keep score on your own. ๐Ÿ˜•

But it will challenge you to think of specific cases, along with specific exclusions, and put them into expressions. It’s good practice.

As far as I can tell (because of course, after the second exercise I was completely over my head), regexProgram runs through the same 10 exercises each time, in a specific order. The README file describes a way to add your own exercises, which is a nice touch.

My only suggestion would be to add line numbers to the exercise array. The “hint” line guides you as you build your expression, but uses line numbers to draw your attention to specific cases. But there are no line numbers shown, which means you have to mentally count down line by line to see what the hint is … hinting at. ๐Ÿ™„

Beyond that, regexProgram is quite straightforward. On-screen prompts and color highlighting make it very quick to learn and read. The version you see above was built with Arch, the only dependency being ncurses (of course) and boost. Debian users can probably build it with the same libraries installed.

And while I wouldn’t call it a game, it’s definitely one worth keeping around, even just for educational purposes. I’m willing to give it a gold star for doing most everything right, incorporating a splash of color, and adding to my education. โญ Cheers! ๐Ÿ˜‰