I am not a programmer, I am a research investigator.
Thus, I have tinkered with code only on an as-needed basis, when I have had very specific problems that I knew a computer could do for me accurately and quickly – changing file names in a folder, performing repetitive editorial tasks, automatically filing downloaded sources with specific names. Most of these things were done in Applescript, and they are all good things for me, because the time they save me gets devoted to thinking that helps me build a case better. I can't hire an intern, because that's expensive, but my meager Applescripting I have done so far has made for a very reliable intern.
Recently, I wanted to write a script that would scan my documents, identify local currency figures, convert them to a global standard ($, €, or Bitcoin), and then insert them into my report copy. This seemed very reasonable to me, and I thought that it would be easy (since everything else I had done had been a simple matter of articulating the problem and finding the solution somewhere online). Time consuming, perhaps, but easy... like reading, copying, pasting, and then tinkering to customize it.
This was not easy.
Someone has suggested I try regular expressions to solve the problem. The thing is, that sentence doesn't mean anything to me, because I don't know where/how to begin, and I don't really know what regex is.
Where would you send someone like me to start learning regex?
Cheers,
-s
Regular expressions are basically just a (powerful) way to match patterns in text. If you've done "ls *.sh" in a directory to list only the .sh files, you've used something very much like a regular expression. But that's just working on filenames, tools like grep and sed can look inside a file and match patterns, and sed can then replace those patterns with whatever you supply.
If you just want to start off learning regexes, google "regex tutorial" and start playing around searching through files with grep or something.
For your specific case, you should be able to do what you want to do with sed[1], or with awk[2]. Or if you're more comfortable with a higher level language, you could go with anything that has regex support, which should be most mainstream languages.
[1]: http://en.wikipedia.org/wiki/Sed
[2]: http://en.wikipedia.org/wiki/AWK