-
1. Re: Grep query - optional character, leading zeros & shortening words
AL-UED Oct 12, 2014 11:32 PM (in response to AL-UED)I worked out the leading zero too (using the beginning of word search with one digit & preceding an upper case letter). [I may end up working this all out myself, at this rate ]
-
2. Re: Grep query - optional character, leading zeros & shortening words
[Jongware] Oct 13, 2014 1:48 AM (in response to AL-UED)Very good -- GREP is a useful tool to master! If you can't work out the last few things, do let us know. Make sure to list a couple of Before-After examples.
The + after \d is indeed for "1 or more", that is, at least one and then as much as possible (I don't think there is a realistic upper limit). Contrast with * which is "zero or more" and ? for "none or exactly 1".
Cutting off month names after the first 3 characters was asked not too long ago, but I cannot recall what the offered solution was. Try something like this:
(?<=\bJan)uary
(replace with nothing). The (?<=xxx) is a positive lookbehind: it will search the text "uary" and only match it if preceded by "Jan". By writing out all months in one long string, you can change all of them:
(?<=\bJan)uary|(?<=\bFeb)ruary|(?<=\bMar)ch|(?<=\bApr)il
... etc., etc., where the vertical bar is an OR operator. (It's a bit long written in full, but remember you only have to write this GREP once and then you can save it.)
-
3. Re: Grep query - optional character, leading zeros & shortening words
AL-UED Oct 13, 2014 3:20 AM (in response to [Jongware])Thank you so much for your assistance, Jongware (custom bullet script?) & explanations of the components - it will help immensely as I didn't necessarily come across the simple explanations of what everything did [& I find I'm now using (read: trying to use) this fabulous tool continuously now but have 'much to learn'!)
-
4. Re: Grep query - optional character, leading zeros & shortening words
[Jongware] Oct 13, 2014 4:48 AM (in response to AL-UED)Hah you're right, IndyFont is from me as well
Concerning GREP: you may be interested in WhatTheGrep: [CS4] Ann.: What the GREP!? It's a straightforward script that explains what you typed in the GREP field. Direct download: http://www.jongware.com/binaries/whatthegrep-0.1.zip
-
5. Re: Grep query - optional character, leading zeros & shortening words
AL-UED Oct 14, 2014 6:00 PM (in response to [Jongware])Wow - that's really handy - thanks again for the info (& Indyfont!)
-
6. Re: Grep query - optional character, leading zeros & shortening words
AL-UED Oct 16, 2014 3:32 AM (in response to [Jongware])I realised how I could shorten to the first 3 letters of the month!
26 July 2015
(\d+) (\u\l\l)\l+ 2015
$1$2
= 26Jul
-
7. Re: Grep query - optional character, leading zeros & shortening words
P Spier Oct 16, 2014 6:04 AM (in response to AL-UED)It won't catch May, though...
Change that last \l+ to \l*
-
8. Re: Grep query - optional character, leading zeros & shortening words
AL-UED Oct 16, 2014 6:16 AM (in response to P Spier)Ah, yes, thank you - I would have gone about doing a few variations - time to familiarise myself with the asterisk...


