Forum Replies Created
-
AuthorPosts
-
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.
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 5:57 am in reply to: Shortest GREP Pattern to address URLs and e-mail addresses? #50793Theunis De Jong
MemberThe only solution I see is making it longer — replace every \w with [\u\d_] 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.
November 20, 2009 at 4:55 pm in reply to: Shortest GREP Pattern to address URLs and e-mail addresses? #53862Theunis De Jong
MemberAnne-Marie, rest assured: that blue glow comes from my screen … really …
And I let my hair loose just for the picture!
Theunis De Jong
MemberDidn't you keep the original Excel file? It would — most likely — mean you have to re-do the formatting, but I don't think that'd survive the round-trip anyway.
Tables are correctly exported in RTF, so you can look at them in Word … well, I got stuck there as I'm not really into Word. Perhaps copy+paste would work from that into Excel.
Here's a suggestion. Convert the tables in InDesign to plain text, with a comma inbetween the values (the Convert-to-text allows you to change it from its default Tab). Then export to plain text, and import as CVS (Comma Separated Values) into Excel.
This does work even if the text contains comma's, tabs and hard returns — you have to replace them with something “safe” first, such as [ThisWasAComma] [etc.] before converting to text.
It will definitely not work for anything else than a pure plain table — in casu, merged cells and columns will be lost or mangled beyond recognition.
November 20, 2009 at 2:30 pm in reply to: Shortest GREP Pattern to address URLs and e-mail addresses? #53852Theunis De Jong
MemberIf you end all with (?=.?), it won't pick up a sentence ending period after the URL. With your expression such a period is used as part of the URLs. And I'm surprised the dash works in your expressions (or .. does it?). I think that in “[w%-/]” it'll match anything from '%' to '/' — adding, for example, the plus sign and the comma. Well, perhaps you wanted it to.
(My personal variant is way, way longer — but it includes php's characters ?, =, & and then some more!)
November 20, 2009 at 9:55 am in reply to: Shortest GREP Pattern to address URLs and e-mail addresses? #50789Theunis De Jong
MemberAnne-Marie, rest assured: that blue glow comes from my screen … really …
And I let my hair loose just for the picture!
Theunis De Jong
MemberDidn't you keep the original Excel file? It would — most likely — mean you have to re-do the formatting, but I don't think that'd survive the round-trip anyway.
Tables are correctly exported in RTF, so you can look at them in Word … well, I got stuck there as I'm not really into Word. Perhaps copy+paste would work from that into Excel.
Here's a suggestion. Convert the tables in InDesign to plain text, with a comma inbetween the values (the Convert-to-text allows you to change it from its default Tab). Then export to plain text, and import as CVS (Comma Separated Values) into Excel.
This does work even if the text contains comma's, tabs and hard returns — you have to replace them with something “safe” first, such as [ThisWasAComma] [etc.] before converting to text.
It will definitely not work for anything else than a pure plain table — in casu, merged cells and columns will be lost or mangled beyond recognition.
November 20, 2009 at 7:30 am in reply to: Shortest GREP Pattern to address URLs and e-mail addresses? #50786Theunis De Jong
MemberIf you end all with (?=\.?), it won't pick up a sentence ending period after the URL. With your expression such a period is used as part of the URLs. And I'm surprised the dash works in your expressions (or .. does it?). I think that in “[\w%-/]” it'll match anything from '%' to '/' — adding, for example, the plus sign and the comma. Well, perhaps you wanted it to.
(My personal variant is way, way longer — but it includes php's characters ?, =, & and then some more!)
Theunis De Jong
MemberAnd let's not overlook Thomas Phinney, last April! Aalways courteous and knowledgeable on the Typophile forum. Fortunately, he popped right up again in a nice interesting senior position at Extensis!
Theunis De Jong
Memberhank_scorpio said:
How do you insert the arabic numbers?… You could insert them manually though, right?
Adi said:
No need to add them manually.
Yah, but that wouldn't work in combination with regular (pardon the expression) numbers going the opposite way, would it?
I'd do it by hand for up to a handful of pages, but for >500, I'd write a script. Scripts are great at counting numbers.
[OT]:
hank said:
I had some books typeset in India. They just deleted all the automatic running heads I had set up and manually typed them in.
A similar experience here — footnotes, created by hand the old fashioned way: separate frames, a line, main text frame shortened by hand … and all of that with InDesign CS3…
Theunis De Jong
MemberAnd let's not overlook Thomas Phinney, last April! Aalways courteous and knowledgeable on the Typophile forum. Fortunately, he popped right up again in a nice interesting senior position at Extensis!
-
AuthorPosts
