Klaus
Wed Nov 05 10:24:22 CST 2003
Hi Hendrik,
Not sure, but perhaps the following three "expressions" might be specific
enough for publications:
-- Full stop and space before;
-- Starts with one or more words, and ends with a four-digit number;
-- Semicolon after.
You could put in <pub>tags</pub> in a first step:
Find what: (. )([A-Za-z\- ]@[0-9]{4})(;)
Replace with: \1<pub>\2</pub>\3
In a second step, you could format the stuff between <pub> and </pub> in a
certain way:
Find what: \<pub\>(*)\</pub\>
Replace with: \1 ((using some character style or formatting))
(The tags are automatically deleted as you replace with \1, the stuff in
the -- first and only -- bracketed pattern)
You'll probably have to add a couple of characters to [A-Za-z\- ] as you go
along ("&", "/", ...).
And even then, you may miss some special cases, or get wrong matches.
To avoid wrong matches (as in "This novel was written 1954; it first
appeared in ..."), you could for example try to limit the length of the
publisher's name to a max of 20 characters or so:
Find what: (. )([A-Za-z\- ]{1;20}[0-9]{4})(;)
Greetings,
Klaus
"hendrik" <hendrik.wfc9o@nospam.WordForums.com> wrote:
> I am trying to style references with macros/wildcards, using the
> find/replace function, like
> 140 Vogler BK, Pittler MH, Ernst E. Feverfew as a preventive treatment
> for migraine: a systematic review. -Cephalagia- 1998; *18:* 704-08.
> I managed to bold the volume numbers, since nowhere else in
> references there are digits followed by a colon. However, I don't
> know how to specify the place where the publications sit: they are
> followed by the publication date, and the semi-colon, but the space
> before is not specific enough (there are many other occurrences of
> a full stop followed by a space), so that any find/replace function I
> created selected more text than I wanted.
> Any solutions?
>
>
>
> ------------------------------------------------
> ~~ Message posted from
http://www.WordForums.com/
> ~~ View and post usenet messages directly from
http://www.WordForums.com/
>