Regular expression confusion!
Hi,
My brain is about to overheat, as I've been trying to get a regular expression to do the following job.
I've been sent a document consisting of a biblical treatise. The author has asked me to mark all biblical references for indexing. They are in the following format where 9 equals numeric and X equals alphanumeric:
Xx. 99:99
9Xx. 99:99
Xx. 99:99-99
Using the find command, I can get the chapter and verse working, i.e.
[0-9]{1,2}:[0-9]{1,2}
But including the book, i.e.
[A-z][0-9]{1,3}. [0-9]{1,2}:[0-9]{1,2}
produces no results. To throw another spanner in the works, adding a -99 is optional, i.e. most don't but some do.
If anyone can come up with a way to include them all, I'd be extremely grateful. It may be that I end up having to find the chapter and vers, then extend the selection somehow,
Thanks,
|