I had thought I had given a 'pure' regex approach (for what its worth) that satisfied your original request, one that can easily be adjusted for the terminal-dot versus no-terminal-dot alternatives, which of these you require being a point I still do not quite grasp. Your response to kcott's reply below indicates you are satisfied with the code you have now, so I will not comment further along these lines.
However, I would encourage you to become familiar with regular expression techniques and be wildered no more! In addition to the valuable links given by others in this thread, I have found Jeffrey Friedl's (admittedly rather expensive) book Mastering Regular Expressions to be very helpful; see his site.
Update: Or perhaps I should have said "be less wildered", for even though I've been using and studying regexes a long time now, I still regularly trip over them and fall flat on my face! But hang in there and enlightenment will come.
In reply to Re^4: I think regex Should Help Here... but How!?
by AnomalousMonk
in thread I think regex Should Help Here... but How!?
by ozboomer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |