Regular Dilemmas

The most exciting part of trying something new is the unexpected. I started work on step four of my process(copy file0.inp to file1.inp) and encountered an unexpected puzzle. The puzzle was how to increment a number embedded in a string. I as a human I can recognize the three parts of the name file0.inp. Any human can see that they are file, 0, and .inp. The trick was turning this intuition into an algorithm. I did some quick googling and found an algorithm that did exactly what I wanted. The algorithm relied on regular expression matching. I was familiar with the concept of regular expression matching as a super extension of scanf. Even though I had an algorithm that worked I wanted to make sure I at least understood the basics of regular expressions. The long and short of it was that I spent 2 hours writing a "simple program" that copied one file to another. But I also learned basic python regular expression syntax (more on that latter). Now the next time I write code like this it won't even take me two minutes. I also see potential for using regular expressions on some of the other steps of the process.