Forum Replies Created
-
AuthorPosts
-
Theunis De Jong
MemberNick,
([,\d]+(.\d+)?)?
will match “, 12.3” but stop after the first comma (and the number after that). “?” is zero or one time.
Change to
([,\d]+(.\d+)?)*
to accommodate for a verse list of any length; “*” stands for zero or more times.
Theunis De Jong
MemberSo what the problem with the math? If someone has problems getting the right answer, well, both Mac and Windows have a calculator

This one is “The sum of 3+3″ — perhaps you could make 'em a bit more difficult, these are no fun at all …
(Windows XP, SP3, IE 8 )
(It's not there when editing a post, I notice.)
Theunis De Jong
MemberChange the leading of that line? The extra space from the leading will stick above and below the font. Note that 'ascender size' doesn't really have to do anything with the actual font size, so setting the leading to the same size as the font will most likely not work.
Changing the leading will cause trouble if the text is larger than a single line. It might be simpler to adjust the offset-below by eye, or using some tactically placed guidelines. You can move the outline of the text wrap with (from memory) the white arrow — make sure you select both bottom anchor points.
Theunis De Jong
MemberYou cannot search the hyphen InDesign adds itself. I would suggest a tiny javascript instead. (Beware! Untested! Your Computer May Explode (etc.))
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = “bw+-w+b”;
result = app.activeDocument.findGrep();
if (result.length == 0)
alert (“No More! No More!”);
else
result[0].select();
Then fix them yourself.
—-< Afterthought, 2 seconds later >—
Ahhhh — perhaps it's easier to apply No Break to the individual parts of the word (but not the hyphen!). You would need two GREP styles for that, one for each half:
<w+(?=-w)
and
(?<=w-)w+>
— both should apply a character style containing No Break. You might want to consider checking a maximum length of the word parts. There are not that many ten-letter-each compound words, but surely you would consider hyphenating “representative-elect”, “three-dimensionalness” or “vice-chancellorship”? (14 letters and more before or after the hyphen; just a few random finds in my English word list)
Theunis De Jong
MemberChange the leading of that line? The extra space from the leading will stick above and below the font. Note that 'ascender size' doesn't really have to do anything with the actual font size, so setting the leading to the same size as the font will most likely not work.
Changing the leading will cause trouble if the text is larger than a single line. It might be simpler to adjust the offset-below by eye, or using some tactically placed guidelines. You can move the outline of the text wrap with (from memory) the white arrow — make sure you select both bottom anchor points.
Theunis De Jong
MemberYou cannot search the hyphen InDesign adds itself. I would suggest a tiny javascript instead. (Beware! Untested! Your Computer May Explode (etc.))
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = “\w+-\w+”;
result = app.activeDocument.findGrep();
if (result.length == 0)
alert (“No More! No More!”);
else
result[0].select();
Then fix them yourself.
—-< Afterthought, 2 seconds later >—
Ahhhh — perhaps it's easier to apply No Break to the individual parts of the word (but not the hyphen!). You would need two GREP styles for that, one for each half:
\<\w+(?=-\w)
and
(?<=\w-)\w+\>
— both should apply a character style containing No Break. You might want to consider checking a maximum length of the word parts. There are not that many ten-letter-each compound words, but surely you would consider hyphenating “representative-elect”, “three-dimensionalness” or “vice-chancellorship”? (14 letters and more before or after the hyphen; just a few random finds in my English word list)
Theunis De Jong
MemberNothing to feel dumb about. I recently switched from 20+ yr uninterrupted pc usage to a Mac — it's a lovely machine but I feel like having butterfingers with even the simplest of operations.

Theunis De Jong
MemberEllipsis: Alt+;
Bullet: Alt+8 (not the keypad one)
If you right-click in text (did you use a one-button mouse? it's similar to Ctrl+click), you can select “Insert Special Character” -> any of Symbols, Markers, or Hyphens and Dashes. The submenu helpfully shows the currently assigned shortcuts. Of course, you can change all of these with Edit -> Keyboard Shortcuts. Look under “Type Menu” for the “Insert xxx” series.
Every default shortcut from InDesign should work, with a little translation: Command -> Ctrl and Option -> Alt.
Theunis De Jong
MemberLastly, i'd like to construct a grep find/change for any spaces or returns at the end of the story and remove those. Once again, thanks so much for your help.
Ah — fortunately, that's an easy one. Z is an (undocumented?) Tag-End-of-Story — A is its Beginning-of-Story equivalent.
This ought to work:
[rt ~S~s]+Z
(Replace with nothing.)
This looks for, and removes, series of Paragraph return, Tab, Space, Non-Breaking Space, and Non-Breaking Fixed Width Space (one of the latter two may have been imported via Word).
(An additional note: GREP cannot change the case of letters. Use the To-Caps function as Casey said, which will add an text attribute, or just search for it with GREP and change manually. For cases like this I assigned hotkeys to the To-Uppercase and To-Lowercase menu items.)
Theunis De Jong
MemberNothing to feel dumb about. I recently switched from 20+ yr uninterrupted pc usage to a Mac — it's a lovely machine but I feel like having butterfingers with even the simplest of operations.

Theunis De Jong
MemberEllipsis: Alt+;
Bullet: Alt+8 (not the keypad one)
If you right-click in text (did you use a one-button mouse? it's similar to Ctrl+click), you can select “Insert Special Character” -> any of Symbols, Markers, or Hyphens and Dashes. The submenu helpfully shows the currently assigned shortcuts. Of course, you can change all of these with Edit -> Keyboard Shortcuts. Look under “Type Menu” for the “Insert xxx” series.
Every default shortcut from InDesign should work, with a little translation: Command -> Ctrl and Option -> Alt.
Theunis De Jong
MemberLastly, i'd like to construct a grep find/change for any spaces or returns at the end of the story and remove those. Once again, thanks so much for your help.
Ah — fortunately, that's an easy one. \Z is an (undocumented?) Tag-End-of-Story — \A is its Beginning-of-Story equivalent.
This ought to work:
[\r ~S~s]+\Z
(Replace with nothing.)
This looks for, and removes, series of Paragraph return, Tab, Space, Non-Breaking Space, and Non-Breaking Fixed Width Space (one of the latter two may have been imported via Word).
(An additional note: GREP cannot change the case of letters. Use the To-Caps function as Casey said, which will add an text attribute, or just search for it with GREP and change manually. For cases like this I assigned hotkeys to the To-Uppercase and To-Lowercase menu items.)
Theunis De Jong
Member[ .. ] group definition
[^ .. ] not group definition — anything except what's inbetween the brackets
[^)] anything but a closing parenthesis
[^)]+ lots of characters, stop on the first encountered closing parenthesis
… but not tested … perhaps the ) needs a backslash? (I didn't think so, because you cannot define groups inside an inclusion group.)
Theunis De Jong
Member(In this case I'd avoid having italicized and regular parentheses right next to eachother. Changing Laurent's expression to
(?<=()[^)]+only(?=))
will do that.)
November 22, 2009 at 12:57 pm in reply to: Shortest GREP Pattern to address URLs and e-mail addresses? #53889Theunis De Jong
MemberThe only solution I see is making it longer — replace every w with [uld_] to catch only alphanumerics and underscore, add /? after the final break to include an optional final slash, and add (?=.?) as the very last part to find, but exclude, an optional period.
I see an additional problem: the designcenter/…/workshop URL contains an ellipsis, which you definitely not want to include (as it doesn't mean anything in URLs). You should have left this as three periods in the original text. (And it seems you might have had five consecutive periods
)Why is it so important to find a shortest possible match? An URL just has a very complex syntax. To catch them all with a single expression, well, you just have to keep adding to a working expression up to the point where you are getting more false positives than you want. It is not as if you have to keep entering it manually into InDesign — that's what Save GREP Query is for.
-
AuthorPosts
