PDA

View Full Version : Wildcards running wild



HJ Norman
10-04-2010, 06:12 PM
I run this line:
"\(?{2,10}:?{2,8}\)"
to find instances of references like
(Ex.17:1-7)
(Deut. 1:41-46)
Successful to some extent, it, however finds unwanted stuffs like
(July 5, 2004 Monday)
(19:2), ...(some twenty pages selected) ...” (19:18)
which are disastrous on batch replace sessions.
Wish I could use it to find occurrences of Biblical refs like (Ex.17:1-7), (Deut. 1:41-46), (2 Sam 1:2-3) only.
This forum is great. I'm thankful to all those involved.

HJ Norman
10-04-2010, 06:41 PM
Ah! It's been solved. I ran this:
\([A-Za-z. ]{2,10}[0-9]{2,8}[:][0-9-]{2,8}\)

I'd still love to read some explanations for it.

...Yet, I still can't include:
(2 Sam 1:2-3)
(1 King 1:2-3)

macropod
10-04-2010, 08:10 PM
Hi HJ Norman,

Try "\([!:\)]{2,10}:[!\)]{1,7}\)"

Explanation: Find an opening parenthesis, followed by a string of any 2-10 characters except a colon or closing parenthesis, followed by a colon, followed by a string of any 1-7 characters except a closing parenthesis, followed by a closing parenthesis. The '\', '!', '[ & ]', '{ & }' are all wildcard control codes.

HJ Norman
10-04-2010, 09:43 PM
Howdy, macropod!
This is great! It's the perfect solution.
Stumped myself, I had run two lines in succesion:
"\([A-Za-z. ]{2,10}[0-9]{2,8}[:][0-9-]{2,8}\)"
"\([1-3]{1}[ ]?{2,10}[:][0-9-]{2,8}\)"
Your [!:\)] is really brilliant! Thank you so much!

Cheers!

macropod
10-04-2010, 10:20 PM
Glad to be of assistance.